Game Development Community

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.

About the author

Recent Threads

  • Newbie behavior questions

  • #1
    01/12/2010 (7:27 am)
    The id is like your social security number. It is generated at creation time and cannot not be changed, nor will it change.
    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...)
    #2
    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
    01/12/2010 (3:18 pm)
    OK, thanks - sounds like I should just think of IDs as pointers, then.


    Thanks!