Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

VR 5.4.0f2: UnityEngine.VR.VRDevice.isPresent is inconsistent with OpenVR + Rift CV1

Discussion in '5.4 Beta' started by Tmtakala, Jul 27, 2016.

  1. Tmtakala

    Tmtakala

    Joined:
    Mar 12, 2014
    Posts:
    16
    Reproduce the bug by setting OpenVR as the first choice in "Virtual Reality SDKs", and have Oculus CV1 connected to your computer.

    Hide the headset from the view of the Oculus camera, so that SteamVR will display the "Not Ready" status and the following message (playing & stopping Unity editor is sometimes necessary):
    "The headset is connected but not tracking"

    These conditions produce below values:
    UnityEngine.VR.VRDevice.isPresent == false // should be true
    Valve.VR.OpenVR.IsHmdPresent() == true

    If Vive is connected and has the same status in SteamVR, then both return true, as it should be.

    I use the UnityEngine.VR.VRDevice.isPresent in applications to detect whether the HMD is connected to the computer, often in Awake() or Start() invocations that are called only once. If that variable returns false then I assume that a HMD is not connected to the computer, and set up my scene accordingly.

    UnityEngine.VR.VRDevice.isPresent shouldn't return false if the HMD is connected and merely occluded from the view of the basestations/cameras.
     
  2. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    Looks like a bug, your assessment is correct. We'll take a look.