Camera switching question
Hi,
I cannot seem to be able to switch between a Oculus Rift Camera (OVRCameraRig)and normal Unity camera, I want to be able to turn off/on Oculus Rift Support ingame...
My test script I have so far is:
var cam1left : GameObject;
var cam1right : GameObject;
var cam2 : GameObject;
var wichcam = 0;
function Update () {
if(Input.GetKeyDown(KeyCode.C)){
if (wichcam==0){wichcam=1;cam1left.SetActive(true);cam1right.SetActive(true);cam2.SetActive(false);}
else{wichcam=0;cam1left.SetActive(false);cam1right.SetActive(false);cam2.SetActive(true);}
}}
Where cam1left+cam1right are assigned each OVR camera, the cam2 is for the normal Unity Camera.. Is disables the gameobects but the Oculus Rift view stays visible and it does not turn off the Oculus Rift rendering..?
I tried moving the OVRManager script to a seperate gameobject but that did not help, I tried searching the web for examples but haven't found anything yet.
Does anyone know how this could be done?
I'm using Unity 4.6 OVR SDK 4.4
Thanks in advance for any advice.
I cannot seem to be able to switch between a Oculus Rift Camera (OVRCameraRig)and normal Unity camera, I want to be able to turn off/on Oculus Rift Support ingame...
My test script I have so far is:
var cam1left : GameObject;
var cam1right : GameObject;
var cam2 : GameObject;
var wichcam = 0;
function Update () {
if(Input.GetKeyDown(KeyCode.C)){
if (wichcam==0){wichcam=1;cam1left.SetActive(true);cam1right.SetActive(true);cam2.SetActive(false);}
else{wichcam=0;cam1left.SetActive(false);cam1right.SetActive(false);cam2.SetActive(true);}
}}
Where cam1left+cam1right are assigned each OVR camera, the cam2 is for the normal Unity Camera.. Is disables the gameobects but the Oculus Rift view stays visible and it does not turn off the Oculus Rift rendering..?
I tried moving the OVRManager script to a seperate gameobject but that did not help, I tried searching the web for examples but haven't found anything yet.
Does anyone know how this could be done?
I'm using Unity 4.6 OVR SDK 4.4
Thanks in advance for any advice.
