cancel
Showing results for 
Search instead for 
Did you mean: 

Struggling to script OVR switch on collision with trigger

vonbetelgeuse
Level 2
Hey guys,

I'm struggling to figure out how to script a change of OVR controller on collision with trigger.

Before I started tinkering I didn't realize the controller is a prefab of two cameras and a series of scripts (total scripting n00b here), so I wrote a script that went like this.

var Camera1 :Camera;
var Camera2 :Camera;

function OnTriggerEnter (col : Collider) {

if(col.gameObject.tag == "Player"){
Camera1.enabled = false;
Camera2.enabled = true;

}
}

I'm not sure what I should classify the variable as, as it can't be one camera as there are two used on each controller.
0 REPLIES 0