Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unable to detect removal of HMD with XRDevice.userPresence

Discussion in 'AR/VR (XR) Discussion' started by NickHitIQ, Jun 21, 2019.

  1. NickHitIQ

    NickHitIQ

    Joined:
    Mar 25, 2019
    Posts:
    1
    Unity 2019.1.0b8

    See: https://docs.unity3d.com/ScriptReference/XR.XRDevice-userPresence.html
    Also: https://docs.unity3d.com/ScriptReference/XR.UserPresenceState.html
    On Oculus and Vive, XRDevice.userPresence appears to be equal to UserPresenceState.Present even when the HMD is removed from a user.

    On Oculus, having no user inside the headset, but keeping the HMD visible of the base stations, results in XRDevice.userPresence remaining equal to Present. On both platforms, removing the HMD from view of their base stations for approximately 10-20 seconds will update the userPresence to NotPresent.

    This seems counter to the desired functionality of XRDevice.userPresence. Both Oculus and Vive headsets have a proximity sensor, and it appears that it may be possible to detect user presence through platform specific libraries. However, is it possible to detect a user being inside a HMD using the XR library in unity?

    Additional threads covering similar topics, none of which seem to resolve satisfactorily:
    https://forum.unity.com/threads/xrd...ity-sensors-for-vive-and-wmr-headsets.689236/
    https://forum.unity.com/threads/xrdevice-userpresence-and-samsung-odyssey.515023/
    https://forum.unity.com/threads/simply-detecting-the-oculus-rifts-presence-solved.294089/
    https://forum.unity.com/threads/ocu...-headset-is-mount-or-not-on-user-head.493684/
    https://forum.unity.com/threads/steamvr-proximitysensor.574471/

    https://stackoverflow.com/questions/27070778/detecting-oculus-hmd-in-unity
    https://www.reddit.com/r/Unity3D/comments/auham4/wmr_headset_xrdeviceuserpresence/
     
  2. joelybahh

    joelybahh

    Joined:
    Mar 18, 2015
    Posts:
    66
    Unity Standalone VR Support doesn't yet fully utilize the 'Generic Functionality' between HMDs (hopefully very soon).

    So it currently seems like it's not possible with unity XR library.

    I'm writing a C# wrapper that gets the proximity sensor status directly from the openvr.dll (Native c++), and will release that when it's done. However, Unity XR proximity works with Oculus for me when using userPresence, only OpenVR requires the 15second wait.
     
  3. lrb

    lrb

    Joined:
    Jun 21, 2014
    Posts:
    27