Using frankenstein code I was able to create a GUI appear when I reach a specific area of the scene. Great! The problem I am running into now is that in order to use the mouse to control the menu the camera is zooming all over the place (because the code it is attached to the main controller). If I could only get the keyboard to interact with the menu then that would solve my problem.
My scene can be found at http://www.eringilman.com/Buku/
Walk into the middle of the room and you will see what I am talking about. Here is the code I am using.... (Taken from someone much more skilled then I on this forum)
private var GetKeyDown : boolean;
private var windowOn : boolean;
private var windowRect : Rect = Rect (150, 150, 120, 50);//window parameters
function OnTriggerEnter (other : Collider) {
buttonOn = true;
}
function OnTriggerExit (other : Collider) {
buttonOn = false;
}
if (Input.GetKeyDown ("b") (Rect (50, 50, 100, 30), "WindowOn")) {
windowOn = true;
}
if (GUI.Button (Rect (25, 100, 100, 30), "Turn Window Off")) {
windowOn = false;
}
if (windowOn == true) {
windowRect = GUI.Window (0, windowRect, WindowFunction, "My Window");
}
}
//take this "else-statement out if you want the activation of the window to be remembered, even if you leave the proximity of the object
else {
windowOn = false;
}
}
function WindowFunction (windowID : int) {
// Draw any Controls inside the window here
}