I have been stuck for a long time reading forums and such. Not all code has to do with GUI. It seems to get to the code and should show the GUI but it will not show up.
#pragma strict
var theDoor : Transform;
private var drawGUI = false;
private var doorIsClosed = true;
function Update ()
{
if (drawGUI == true && Input.GetKeyDown(KeyCode.F))
{
changeDoorState();
}
}
function OnTriggerEnter (theCollider : Collider)
{
if (theCollider.tag == "Player")
{
Debug.Log("Enter");
drawGUI = true;
}
}
function OnTriggerExit (theCollider : Collider)
{
if (theCollider.tag == "Player"){
drawGUI = false;
}
}
function onGUI ()
{
if (drawGUI == true) {
GUI.Box (Rect (Screen.width*0.5-51, 200, 102, 22), "Press F to open");
}
}