Is an object's id guaranteed not to change?
by Ken Lao · in Torque Game Builder · 01/12/2010 (5:50 am) · 3 replies
If I do a myobj.getId(); to get the ID of my object, should I expect that that number will not change over the course of my level?
Just wondering if I can convert my object names to IDs in my script immediately upon loading, or if I should hold onto the names.
Thanks.
Just wondering if I can convert my object names to IDs in my script immediately upon loading, or if I should hold onto the names.
Thanks.
#2
loadlevel functions and/or resetting the scenegraph resets the object id's...i.e.the same object is referenced using a new id
01/12/2010 (11:40 am)
i was working on id's, had to totally redo the project and use names as reference...loadlevel functions and/or resetting the scenegraph resets the object id's...i.e.the same object is referenced using a new id
#3
Thanks!
01/12/2010 (3:18 pm)
OK, thanks - sounds like I should just think of IDs as pointers, then.Thanks!
Torque Owner Heiko Sippel
Default Studio Name
Contrary to names, the id is unique. If you give two objects the same name, you can only refer to the second object with it (I believe...)