I want to make GUI Text to show up when I hover mouse over gameObject, and I want to display gameObject's name. Problem is that when I hover over gameObject GUI Text is created but I cant seen it anywhere. Here is part of code that uses GUI Text:
var name : String = "Player"
var textObject : GUIText;
function OnMouseEnter() {
textObject.text = gameObject.name;
Instantiate(textObject, transform.position, transform.rotation);
}
↧