i’m on unity 5.4 something and i need to create a simple 2D text object that i can move around in script and change the text value, its for a tooltip kind of function.
so i create an empty gameobject, call it hovertext, drag it into my canvas, then on hovertext, i add a component->rendering->GUI Text,
in the inspector give the text a string ‘xxxx’, set position to 0, give it a nice bright color, material, font, font size etc.
but i don’t see it in game view or when i run the game.
however, in a function, i do this
void Start()
{
gizmoText = GameObject.Find(“HoverText”).GetComponent();
gizmoText.text = “start”;
}
and it appears to work internally, i see the .text is ‘xxxx’ before i change it, so its just a display issue. any idea what i’m doing wrong?
and is this even the right way to do 2D text in unity 5?
thanks
FYI, my canvas is in screen space overlay
PS, i tried using Text instead of GUIText and it seems to be working now, but not sure if that’s the right thing to do