Sorry if this has been answered elsewhere, I searched but couldn’t find the answer.
I have a simple GUIText, made by the Game Object > Create Other > GUIText menu.
I’ve created an animation for it, which works.
Now, I want to hide it, until the player hits a trigger. That’s all! I’m sure it’s something.enabled = true/false in js, but everything I try gives me various errors.
Any help would be gratefully received, (and sorry for the noob question)
Thanks
Ian
Try to use this code :
//to enable
var guiComponent = GetComponent("GUIText").guiText;
guiComponent.enabled = true;
Let me know if this helped you
guiComponent.enabled = true; doesn’t seem to work in my case but
guiComponent.active = true;
does. I have no idea why but can’t hurt to have an option.