GuiText Not Visible

I instantiated an object at the load of a scene, attached to the main "Game Object" Container is a GUIText object, a trigger box, and a model. I am trying to make it so that when you enter the trigger box the text becomes visible and when you exit the trigger box the text becomes invisible Variables are being changed on entrance and on exit but I cannot seem to make the text visible. here is my trigger box code.

function OnTriggerEnter(collisionInfo : Collider)
{
    Debug.Log(transform.parent.Find("ActionGUIText").GetComponent(GUIText).anchor);
    Debug.Log(transform.parent.Find("ActionGUIText").GetComponent(GUIText).text);
    transform.parent.Find("ActionGUIText").GetComponent(GUIText).text = "Press E to Mine!";
    Debug.Log(transform.parent.Find("ActionGUIText").GetComponent(GUIText).text);
}

function OnTriggerExit(collisionInfo : Collider)
{
    transform.parent.Find("ActionGUIText").guiText.text = "";
}

does it trigger at all? one of your colliders should have a kinematic rigidbody or normal rigidbody attached for the trigger events to work.

did you tested the gui text in normal situation to see if it's position/scale/... is correct and could show the text?

i know that this code is an example but if you want to use something like this multiple times, find it once and use a reference to it for your other calls.

var g : GUIText = transform.parent.Find("ActionGUIText").GetComponent(GUIText);

then use g to get the text property and doing other things. it's much faster to find once than multiple times.

You might try using a 3DText instead, if you want it to look like it is somewhere in the game world. Otherwise, try not childing the GUItext to anything -- just leave it in the middle-top. The difference is a GUItext is always flat towards you, and 3DText looks like an actual sign in the world.

GUIText is made to be placed somewhere on the screen, using nice (0,0) to (1,1) coords. That way (0.5,0.5) is the center of the screen, without having to think about pixels. Childing it to something moving in the world completely breaks the numbers. You have to translate back to the 0-1 scale, using `Camera.WorldToViewPortPoint` (which is tricky, but looks nice when you get it.)

As the previous poster wrote, I'd guess if you started with XYZ in the GUItext, you still wouldn't see anything, since the parent is pulling it off the screen.