Hi, here’s my problem:
I have a car running and eventually it comes out of fuel. This is controlled by a script in the car, so when this happens i want a GUIText shows an “Out of fuel” message. I’ve tried this with OnGUI but i had only problems as i’m using OnGUI for showing up a chronograph. So, i set the GUItext as disabled at the beginning of the stage (in inspector) and then i use this code:
gui_combustible = GameObject.Find ("GUI Text Combustible");
if (evento == 0) gui_combustible.SetActive(false);
else if (evento==1) gui_combustible.SetActive(true);
where the variable “evento” becomes 1 when fuel runs out.
The problem is the object GUItext never shows up. The name of this object is actually “GUI Text Combustible”.
What am i doing wrong?