|
what im trying to do i activating a gui if the person enters a trigger then reset to hide if exiting a trigger var showGUI = false; var source2 : Texture2D; var source : Texture2D; function OnTriggerEnter(other : Collider){ if(other.gameObject.tag == "source"){ GUI.Box (Rect (10,10,200,100), GUIContent("400", source)); } } function OnTriggerExit(other : Collider){ if(other.gameObject.tag == "source2"){ GUI.Box (Rect (10,10,200,100), GUIContent("400", source2)); } } function ongui () { GUI.Box (Rect (10,10,200,100), GUIContent("400")); GUI.enabled = true; }
(comments are locked)
|
EDITEDOk, I changed this for what you said below, I think this should work. Just attach this script to your player ... You'll have to modify it for whatever other content you're wanting to do, I'm just showing you a way I think for you can trigger the gui.
I think that should do it. Just tag your GUI trigger object whatever you want and replace the "MyGuiDoohickeyTagWhateverInamedIt" in the script to whatever your tag is called. Then add some script for GUI.Box or whatever down near the bottom there. im trying to activate it on a trigger so if the first person enters the gui it will display the specific gui. if its out side the trigger it will be invisible what im trying to do is like a navigator...
Dec 23 '11 at 05:05 AM
cariaga
I don't get it... "the first person Enters the GUI" ?? The 3D character enters 2D space??
Dec 23 '11 at 05:16 AM
Lo0NuhtiK
what i mean is. first person "enters trigger" and it will activate the gui that has specific texture2d and if it exits the trigger it will make the gui invisible sorry :P bad English
Dec 23 '11 at 12:47 PM
cariaga
(comments are locked)
|
