make gui text disappear.

ok so i have a simple text where it says at the top press WASD to move…blah blah blah… the problem is i want it to disappear when i click on it or make it disappear after a couple of seconds

var time = 10; //Seconds to read the text

function Start ()
{
yield WaitForSeconds(time);
Destroy(gameObject);
}

Put this script on your guiText.

If U want it to disappear when a button is pressed

var Instructions : Transform;

 

function Start () {

 

}

 

function Update () {

        if(Input.GetKeyUp(KeyCode.Mouse0)){ //LeftMouseButton Disables Instructions

                Instructions.active = false;

        }

        

}

Just attach it to GUI and Select the Gui (youre Instructions) as the Varible Instructions It will Disapear after the left mouse button is pressed…If you want a other key simply change Mouse0 to the button u want for E.G. F

Hope it helps…

P.S. This is my First Post…