cancel
Showing results for 
Search instead for 
Did you mean: 

cameras on different scenes

creat326
Protege
Hi

I have two different scenes in my game. One is the main menu with a OVRCameraRig #1 that works just fine.

The second scene, is the actual game. it is loaded additively to the first one and it also has a OVRCameraRig #2 on it.

When I load this second scene, the first thing I do is disable the #1 OVRCameraRig gameobject since it has different settings for layers and far distance and all that.

The problem is that when you load the second scene, things get nasty on the Gear VR (sometimes just freezes the game). Why? Well, it seems that since both have a OVRManager, it creates a problem.

Looking at the code, OVRManager allows for only one instance of it. So the problem is that when I load the second scene, internally it is still pointing to the old OVRManager but its gameobject was disabled.
If I don't disable it, then it takes the info from the #1 stuff and ignores the #2 and things begin to look messy, I believe it's getting rendered 4 times (2 per camera and 2 OVRcameraRigs)


In short, how can I load additively a new scene which also contains a OVRCameraRig, disable the first one and enable this second one without getting OVRManager into a mess?
Dogfight Elite now available for Oculus https://www.oculus.com/experiences/quest/3881629141886138/
1 REPLY 1

CorvusVR
Protege
I haven't tested but in theory calling "DontDestroyOnLoad" will solve your problem (just have one OVR camera prefab and keep it between scenes).

http://docs.unity3d.com/ScriptReference ... nLoad.html