Disabling & Enabling UI Text?

According to Unity guiText is outdated and it insists on using < GUIText >() because of which none of any of the answers prior to 2015 seem to work for me. I’ve tried many things, but I am not sure how to approach this at all because nothing seems to work and all of the answers are old and don’t work.

My situation is this: I have made text with the Canvas UI. I have unchecked the script part of the Text so it is hidden and essentially disabled. The title of the text is TEXT TEST, how do I enable/show it?

~UPDATED~

I am now using this code and get the error “unexpected token: )”

import UnityEngine.UI;


function myFunction() {
var winShow : GameObject;
winShow = GameObject.Find("TEXT TEST");
winShow.GetComponent<Text>().enabled = false; // Line I get the error on.
}

The new Text component is just called “Text” and not guiText or GUIText.
If you like to interact with the UI via script you need to include the UI namespace like this:

import UnityEngine.UI;

Then you can enable the text component like this:

GetComponent.<Text> ().enabled = true;

Hi.

You Missed a dot after GetComponent :

winShow.GetComponent.<Text>().enabled = false;

Not :

winShow.GetComponent<Text>().enabled = false;

Regards.