Persist the forward direction of google cardboard map on scene loading in Unity3D 4.6.7?

I am having trouble trying to save what Google Cardboard considers to the device after loading a scene. While I can't find an obvious call to this in the C # SDK code, it looks like the Google Cardboard SDK will automatically call the Recenter after every scene load. I've tried calling DontDestroyOnLoad on the encapsulated carton and Cardboard.SDK object (which is mentioned on line 328 of Cardboard.cs). This preserves these objects throughout the load, but the view is still re-centered based on the current device orientation.

I want to avoid reuse because some of the view-based menu items that can initiate loading are disabled for the user on the left or right, which then makes a new center on the left or right after the scene loads. The user then has to physically move their body so that it faces the new one forward.

Is anyone else trying to do the same? Am I missing something?

Any suggestions are greatly appreciated!

+3


source to share


2 answers


The Cardboard.OnLevelWasLoaded () function calls device.Reset (), which in the base class implementation simply calls Recenter (), which has the effect you see. If you comment out that line, or store it with a variable that you can control, then face shouldn't reset.



0


source


I had the same problem but on Gear VR (Unity 5). If anyone else is looking for this, I answered it here .

In short, if you also use OVR Utilities from Oculus:



  • Find the OVR script dispatcher connected to OVRCameraRig
  • Uncheck 'Reset Tracker On Load'
0


source







All Articles