do gameobject has unique ids associated with them i could use? something other then gameObject.name as that appears to not be unique if i instantiate a gameobject. (though im guessing i could change it)
if i have a game object is there a way to discover what prefab was used to instantiate that object?
Sorry to jump in, but I’m curious about this too as I’ve been using GUIDs for identifying objects.
At what point is the object ID (returned by GetInstanceID) generated? Is it created when the object is initially added to the scene hierarchy (through editor or instantiation) and after that always remains the same? Or is it regenerated every time the game is run? Or… other?
geppetto: The instance ID is uniquely generated every time for each object that is added to the hierarchy (either by instantiate or pre-placement), and yes, the ID changes every time the game runs. If you need a pre-set unique ID, you’re better off making a public variable in a script and set its ID manually, for any other script to fetch and use.