problem with UI stuff

idk if this is the right forum, forum but UI stuff not working correctly, I’m trying to enable and disable text, here’s code:


public GameObject shot;

void Start(){
shot.setActive(false);
}

void Update() {
shot.setActive(true);
}


when I use this unity returns this error: ‘GameObject’ does not contain a definition for ‘setActive’ and no accessible extension method ‘setActive’ accepting a first argument of type ‘GameObject’ could be found (are you missing a using directive or an assembly reference?)

setActive” should be “SetActive”. Capitalization matters.
All this script will do though is endlessly set shot active.

1 Like

Thx! ok I wasn’t actually using this script like that, what I just re framed it so it’d be less confusing, it’s actually so that when you take dmg shot activates.