Forum Discussion
VenomMouse
6 years agoHonored Guest
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
- 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
VenomMouse said:
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:
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 9 months ago