- Home /
GUIText appears/disappears problem
Hello everyone,
I tried to search an answer to my problem but it seems nobody has got the same error. I have some Gameobjects in my scene. I want to make appear the name of the object when my cursor is on and make disappear the name when the cursor is out. I created some GUItext. I attached this script on each game objects : var element : GUIText;
function Start () {
element.enabled=false;
}
function Update () {
}
function OnMouseOver(){
element.enabled=true;
}
function OnMouseExit(){
element.enabled=false;
}
I put all the GUItext on each slots from the scripts on the gameobjects.It works but the problem is that when I start the game, some words are already apparent when the cursor is not even on the object. And then, when I place my cursor over objects with the words in question get everything in order. I'm looking for the solution that words do not appear early. Where is my mistake? I've tried deleting objects, texts in question and even the colliders but nothing works ...
Why not one single GUIText that displays different names?
I found the solution, I only have to check/uncheck some Guitext checkbox in the GUI...-_-'