I have created a cardboard app in Unity that needed to be ported to Daydream. The app is needs to start in 2d Mode and if the user has a daydream device, they can press a button to switch to VR mode. When I add “None” as the first device in the list of supported VR Devices in player settings, the app starts in 2D/non-vr mode.Since the GvrControllerMain has already been added to the scene, it gives an error. I disabled the GvrControllerMain object in the scene and the errors went away. Now when the button is tapped to turn on the VR mode, i enable GvrControllerMain and call
VRSettings.LoadDeviceByName("daydream")
VRSettings.enabled = true;
but there are errors in the console
Null GVR context pointer, could not get GVR user prefs' handedness
02-13 16:35:32.240 9486 9505 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
02-13 16:35:32.240 9486 9505 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
02-13 16:35:32.240 9486 9505 I Unity : UnityEngine.Logger:Log(LogType, Object)
02-13 16:35:32.240 9486 9505 I Unity : UnityEngine.Debug:Log(Object)
02-13 16:35:32.240 9486 9505 I Unity : GvrSettings:get_Handedness() (at /Users/mac6/Projects/Git/App/Assets/GoogleVR/Scripts/GvrSettings.cs:94)
02-13 16:35:32.240 9486 9505 I Unity : GvrArmModel:UpdateHandedness() (at /Users/mac6/Projects/Git/App/Assets/GoogleVR/Scripts/Controller/GvrArmModel.cs:220)
02-13 16:35:32.240 9486 9505 I Unity : GvrArmModel:OnControllerUpdate() (at /Users/mac6/Projects/Git/App/Assets/GoogleVR/Scripts/Controller/GvrArmModel.cs:200)
02-13 16:35:32.240 9486 9505 I Unity : <EndOfFrame>c__IteratorB:MoveNext() (at /Users/mac6/Projects/Git/App/Assets/GoogleVR/Scripts/Controller/GvrController.cs:347)
02-13 16:35:32.240 9486 9505 I Unity : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
This error is due to the gvrContextPtr not being found.
Any ideas on how to fix this?