Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Top VR SDK reverts to None after level change

Discussion in 'AR/VR (XR) Discussion' started by NUMENAVR, Jan 6, 2018.

  1. NUMENAVR

    NUMENAVR

    Joined:
    Jan 3, 2017
    Posts:
    1
    If I manually drag the OpenVR SDK to the top of the SKD list, it all works fine until I change the scene. In the newly opened scene, "None" is back on top. I tried enabling OpenVR from code in each scene, but I'm getting the "Assertion failed: Assertion failed on expression: 'IsMatrixValid(matrix)'" error. Below is the coroutine I'm using. How can I fix it?

    IEnumerator SwitchToVR()
    {
    string desiredDevice = "OpenVR";
    if (UnityEngine.XR.XRSettings.loadedDeviceName == desiredDevice)
    {
    yield break;
    }
    XRSettings.LoadDeviceByName(desiredDevice);
    yield return null;
    XRSettings.enabled = true;
    }
     
  2. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    480
    Anybody know why this happens? Super annoying.