Search Unity

Unique IDs for GameObjects?

Discussion in 'Scripting' started by nintari, Sep 2, 2009.

  1. nintari

    nintari

    Joined:
    Jul 7, 2009
    Posts:
    100
    Is there any way to get at a unique id number for the GameObjects? I don't want to rely on making sure all of the GO names are unique, but I do want a way to access specific GOs via a unique id.
     
  2. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    GameOBject.GetIstanceID()

    returns an uniquely id of your game Object :)
     
  3. nintari

    nintari

    Joined:
    Jul 7, 2009
    Posts:
    100
    Thanks! That was exactly what I was looking for.