- Home /
displaying object''s name in GUIText on mouse over
I need a text with object's name appearing on the screen if the mouse goes over an object...
(I know this shouldn't be too difficult....but I'm new to unity and to scripting and I can't do it)
Comment
Best Answer
Answer by Eric5h5 · Apr 30, 2010 at 06:57 PM
Put this on the object (which needs a collider for this to work) and drag a GUIText object onto the slot in the inspector:
var textObject : GUIText;
function OnMouseOver () { textObject.text = gameObject.name; }