By CuriscopeKidd
on Mon, 02/19/2018 - 17:37
Hello everyone,
I have a problem, on device whilst trying to switch from MixedReality.mode.VIEWER_AR_DEVICETRACKER to MixedReality.mode.VIEWER_VR on device I get the following exception:
Timeout while trying to initialize Google VR.
We are using the following set up:
- Vuforia:7.0.36
- GoogleVR:1.110.0
- Unity:2017.3.0f3
- Device: Samsung Galaxy S8
We *have* to use Google Cardboard as our VR integration because our legacy project relies on certain functionality provided by this API. We have created an empty project and can switch modes sucessfully on the same device every 10 seconds cycling from:
1 - XRSettings.LoadDeviceByName("")
2 - XRSettings.LoadDeviceByName("GoogleVR") + MixedReality.mode.VIEWER_AR_DEVICETRACKER
3 - XRSettings.LoadDeviceByName("") + MixedReality.mode.HANDHELD_AR
4 - XRSettings.LoadDeviceByName("GoogleVR") + MixedRealityController.Mode.VIEWER_VR
I notice in the repro we are not going directly from VIEWER_AR_DEVICETRACKER to VIEWER_VR - could this be the problem ?
I haven't seen the 'Timeout while trying to initialize Google VR' exception before, obviously it happens at the point in our code where we:
XRSettings.LoadDeviceByName(GVR);
yield return null;
XRSettings.enabled = true;
InputTracking.disablePositionalTracking = true; //no 'neck' or 'head' adjustment
MixedRealityController.Instance.SetMode(MixedRealityController.Mode.VIEWER_VR);
Does anyone have any ideas ?
So, it turns out I was
So, it turns out I was initialising google vr twice.
UnityEngine.XR.XRSettings.LoadDeviceByName(); does not appear to be case-sensitive
So whilst I was loading "Cardboard" (capital c) UnityEngine.XR.XRSettings.loadedDeviceName returned "cardboard"