hi
i’m using unity 3.5
i want active an object in script
how can i do this?
i use SetActive method but it’s got error
error text :
Assets/Scripts/GameManager.cs(39,34): error CS1061: Type UnityEngine.GameObject' does not contain a definition for SetActive’ and no extension method SetActive' of type UnityEngine.GameObject’ could be found (are you missing a using directive or an assembly reference?)
tnx 4 adv
burnill
2
SetActive reference
GameObject.SetActive() needs to have a lowercase G at the start or replace GameObject with a reference to a game object for example:
var explosion : GameObject;
function Awake ()
{
explosion.SetActive(false);
}
OR
// Deactivates the game object.
gameObject.SetActive (false);
robhuhn
3