Jump to content

setElementData class problem


Frozia

Recommended Posts

Hey everyone, I'm trying to do something.But I have some errors.I cant store a class with setElementData.

  
local objects = getElementData(scene,"objects") 
table.insert(objects,object); 
setElementData(scene,"objects",objects) 
outputDebugString(tostring(objects[1]:PositionX(5))) -- it works  
objects = getElementData(scene,"objects") 
outputDebugString(tostring(objects[1]:PositionX(5))) -- but it doesnt work. 
  
  

What is the problem ?

Element is correct. I know it because I'm using it in clientRender.

Link to comment
The debug doesn't output anything?
local objects = getElementData(scene,"objects") 
table.insert(objects,object); 
setElementData(scene,"objects",objects) 
outputDebugString(tostring(objects[1]:PositionX(5))) -- Outputs: 5 (as I want) 
objects = getElementData(scene,"objects") 
outputDebugString(tostring(objects[1]:PositionX(5))) -- Outputs: 'PositionX' is nil 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...