- Home /
Question by
CB-TV · May 15, 2014 at 07:06 PM ·
gameobjectsetactiveactivegui texture
The best overload for the method 'UnityEngine.GameObject.SetActive(boolean)' is not compatible with the argument list '()'.
Two errors:
The best overload for the method 'UnityEngine.GameObject.SetActive(boolean)' is not compatible with the argument list '()'.
Expression 'self.gameObject.Find('Image').SetActive()' cannot be assigned to.
My script:
function Update ()
{
if (yess)
{
gameObject.Find ("Image").SetActive() = false;
}
}
yess is set to true in an OnGUI function. What is the problem here? I've used .active but it doesn't seem to work? Do you know anything?
Comment
Best Answer
Answer by Vitor_r · May 15, 2014 at 07:13 PM
Use this function:
function Update (){
if (yess){
gameObject.Find ("Image").SetActive(false);
}
}