Activate the disabled gameobject??

hi there,
i created a gameobject and set it’s active value to
false,
the question is how can i set it active again?
because once it’s active is set to false, i can’t use functions like GameObject.Find() ObjectFindType…to get its handle,like it’s lost!

what should i do or which functins should i use to find it? thanks!

another question:
how can i use runtime functions to get a prefab id and use this to create a instance?(if i don’t want to define a empty var and choose it from the gui but just get it from script directly)

you must store the reference to the object somewhere.
if you deactivate a game object, it no longer exists in the world as such and can not be found through any of the retrieval functions, just through a straight reference.

Resources.Load will allow you to instantiate a prefab without first referencing it in a script. The only catch is that the prefab has to be stored in the Resources folder, otherwise it won’t be included in the build. The example code given in the script reference is pretty clear:

// Instantiates a prefab at the path "Assets/Resources/enemy".
function Start () {
    var instance : GameObject = Instantiate(Resources.Load("enemy"));
}

@Matthew Miner

thanks a lot ,that’s exactly what i want!!!