- Home /
switch game object on of by trigger with VR
Hi all Unity Goeroes,
I am new to scripting (totally green), (not to 3d) and I am working on a serious "game"with oculus rift for a client. I want the following: that a image appears and disappears when I pass by it with my Oculus Rift controller I used script below which I downloaded (http://pastebin.com/wQaAHPfS), but this doesnt work with Oculus Rift. I think it has to do with OnGUI? But as I said I am a newbee to scriptingt. Anyone a suggestion or an other solution?
var toggleGUI : boolean; var TurnImage : Texture2D;
function OnTriggerEnter (other : Collider) { toggleGUI = true; }
function OnTriggerExit (other : Collider) { toggleGUI = false; }
function OnGUI () { if (toggleGUI == true) GUI.DrawTexture(Rect(Screen.width / 2-150, 0,300,300), TurnImage); }
Your answer
Follow this Question
Related Questions
i need detailed instructions... cue texture 1 Answer
Turn On and Off Lights Via Script 1 Answer
fetching a value 1 Answer
UI Button ON/Off 3 Answers
Bounce back to previous platform upon collision/trigger 0 Answers