Forum Discussion
sh0v0r
13 years agoProtege
Correct Way To Detect The Hardware
I'm trying to make my game automatically switch to OVR mode when the Hardware is detected but I'm unsure as to how to do that correctly? I have tried doing this: if (OVRDevice.IsHMDPresent()) ...
drash
12 years agoHeroic Explorer
Just checked on this for clarity:
OVRDevice.IsHMDPresent() tells you whether the DVI/HDMI cable is connected/recognized between the control box and the PC. Didn't check if it's hot-swappable.
OVRDevice.IsSensorPresent() tells you whether the USB cable is connected between the control box and the PC. Seems to be hot-swappable.
If you're able to toggle between Rift mode and monitor mode on the fly, the logic could be simply "any time either HMD or Sensor is not present, revert to standard monitor mode".
Warning: It does not appear you can rely on these values returning the correct value until after Awake()/Start(). Either fiddle with script execution order, or put your Rift-detection logic in Update().
OVRDevice.IsHMDPresent() tells you whether the DVI/HDMI cable is connected/recognized between the control box and the PC. Didn't check if it's hot-swappable.
OVRDevice.IsSensorPresent() tells you whether the USB cable is connected between the control box and the PC. Seems to be hot-swappable.
If you're able to toggle between Rift mode and monitor mode on the fly, the logic could be simply "any time either HMD or Sensor is not present, revert to standard monitor mode".
Warning: It does not appear you can rely on these values returning the correct value until after Awake()/Start(). Either fiddle with script execution order, or put your Rift-detection logic in Update().
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
- 3 years ago
- 2 years agoAnonymous