Simple Script to Switch between VR Mode/Standard Mode
https://www.mediafire.com/?wzz87elmuq4tg48
Well.. since it seems to be something that a lot of people want to do but not everyone knows how to do it..
I've decided to attach here a really simple script to switch in-game between the OVRCameraRig and a standard Camera.
A lot of people are encountering issues related to the OVRManager,so when you try to switch between the two Cameras the editor freezes.
With this script and a little trick you should be able to switch between them without issue.
1) Remove the OVRManager from the OVRCameraRig and attach it to an external object(like a random cube or what you want).
2) Put the Standard Camera in the same position of the OVRCamera Rig,then attach my script to the OVRPlayerController(Or FPS Controller or your main controller..)
3) There are just 3 public variables on my script. Standard Camera,VR Camera and OVR Manager,so just move your "Main camera" into the Standard Camera field,your OVRCameraRig into VR Camera field.. and the object with the OVRManager script attached into the OVR Manager field.
Everything is now ready to work..
Just use "H" on the keyboard to switch between Standard Mode and VR Mode. If you want change key to switch between the modes,just change
and replace the key you want to use instead of "H" after KeyCode.
and do the same here
Hope that helps.. sorry to have explained everything in this "noob" way but i guess it will be more helpful like that for some people.
Also I'm sorry in advance if the script could be better written or even simple to use..
Well.. since it seems to be something that a lot of people want to do but not everyone knows how to do it..
I've decided to attach here a really simple script to switch in-game between the OVRCameraRig and a standard Camera.
A lot of people are encountering issues related to the OVRManager,so when you try to switch between the two Cameras the editor freezes.
With this script and a little trick you should be able to switch between them without issue.
1) Remove the OVRManager from the OVRCameraRig and attach it to an external object(like a random cube or what you want).
2) Put the Standard Camera in the same position of the OVRCamera Rig,then attach my script to the OVRPlayerController(Or FPS Controller or your main controller..)
3) There are just 3 public variables on my script. Standard Camera,VR Camera and OVR Manager,so just move your "Main camera" into the Standard Camera field,your OVRCameraRig into VR Camera field.. and the object with the OVRManager script attached into the OVR Manager field.
Everything is now ready to work..
Just use "H" on the keyboard to switch between Standard Mode and VR Mode. If you want change key to switch between the modes,just change
if (Input.GetKeyDown (KeyCode.H) && Check==false){ 17th lineand replace the key you want to use instead of "H" after KeyCode.
and do the same here
else if (Input.GetKeyDown (KeyCode.H) && Check==true){ 23th lineHope that helps.. sorry to have explained everything in this "noob" way but i guess it will be more helpful like that for some people.
Also I'm sorry in advance if the script could be better written or even simple to use..
