Making a GUIText disappear for 5 seconds??

I am trying to get a guitext to disappear for a few seconds, here is my code, but I am getting a error because its not a mesh with a renderer. How can I make this work??

/
/
/
 private float LRFInvisTime = 5.0f;
    public GameObject LRFReady;

   
  	void Update()
	{
	 if (Input.GetButtonDown("LRF"))
	{
     StartCoroutine(LRFCharging());
    }
	}
	IEnumerator LRFCharging()
	{
		gameObject.renderer.enabled = false; 
		yield return new WaitForSeconds(LRFInvisTime);
		{
		    gameObject.renderer.enabled = true;
			
		}
	}
}
/
/
/

Would moving the guitext in -z space do it, if so, how would I write it?

You have it right, but instead use:
gameObject.guiText.enabled = false;

That didn’t do it, am I missing something??

Anyone know why this wouldn’t be working???

I got this to work by attaching the guitext to a empty gameobject.

It works fine.

The updated Coroutine:

IEnumerator LRFCharging () {
    guiText.enabled = false;
    yield return new WaitForSeconds (LRFInvisTime);
    guiText.enabled = true;
}

EDIT: Guessing from the post above… the GameObject with the GUIText is the LRFReady object.

IEnumerator LRFCharging () {
    LRFReady.guiText.enabled = false;
    yield return new WaitForSeconds (LRFInvisTime);
    LRFReady.guiText.enabled = true;
}

Yeah, i didn’t realize I had to create the empty gameobject then add the GUIText componet to it…I’ve been pulling my hair out all day ont his one, then it just came to me…

It works, but if I try and make it visible in one camera and not on another with this script-

/
/
/
using UnityEngine;
using System.Collections;

[RequireComponent(typeof(Camera))]
class GUIEnableDisable : MonoBehaviour 
{
    public GUIElement[] enableWithThisCamera;
    public GUIElement[] disableWithThisCamera;
	
    void OnPreCull() 
	{
        if( enableWithThisCamera != null ) foreach(GUIElement element in enableWithThisCamera) if( element ) element.enabled = true;
        if( disableWithThisCamera != null ) foreach(GUIElement element in disableWithThisCamera) if( element ) element.enabled = false;
    }
}
/
/
/

It doesn’t work anymore???

Has anyone have any clues as to why this won’t work on a GUIText if it is referenced int he above code???

What I did was by pass the disable/enable code for the cameras above and just put the GUIText on a layer and stopped the camera from seeing that layer. I did try that before, but it was before I actually fixed the GUIText disappearing issues…