Skip to main content
New Participant
April 29, 2020

Check if OpenVR / SteamVR / OculusVR headset is mounted on your head

The Oculus and the Vive have this light proximity sensor that detects whether you have your VR headset placed on your head currently or not.

Is there any way to tap into that for our own game checks? E.g. We could pause or restart the game depending on whether the headset's being worn or not.

I'm using Unity/C#, but any (driver / API level) help is much appreciated.

    1 reply

    kojack
    Honored Contributor
    April 29, 2020
    No idea about steamvr, but in the oculus sdk:
    C#/Unity: OVRManager.isUserPresent is a bool that says if the headset is currently being worn. You can also register a delegate with OVRManager.HMDMounted and OVRManager.HMDUnmounted to get events when they happen.

    C++:
        ovrSessionStatus status;
        ovr_GetSessionStatus(g_HMD, &status);
        if(status.HmdMounted)
            // it's being worn



    E.g. We could pause or restart the game depending on whether the headset's being worn or not.


    Actually for single player games this is required behavior to get on the Oculus store:







    Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3