Forum Discussion
dignifiedweb
11 years agoExpert Protege
Check for health and safety warning
Hi guys,
Does anyone know how to get whether the health and safety warning is displayed in a unity project? I think I am just missing something really simple.
Reading the API, it looks like I call it like this:
My main problem is I don't understand how to create an object reference to Ovr.hmd. I have an OVRCamera in my project, is there some way I can get the IntPtr hmdPtr of the head mounted display in use? Or, is it more of a standard to call the static method like this:
If the above code is what I need to use, any advice on using the detect method? It doesn't seem to return the correct integer of the Hmd in use.
Any advice on how to get a reference to the current HMD would be greatly appreciated. My apologies if this has been discussed before.
Does anyone know how to get whether the health and safety warning is displayed in a unity project? I think I am just missing something really simple.
Reading the API, it looks like I call it like this:
if(_hmd.GetHSWDisplayState().Displayed)
{
Debug.Log("warning is displayed");
}
My main problem is I don't understand how to create an object reference to Ovr.hmd. I have an OVRCamera in my project, is there some way I can get the IntPtr hmdPtr of the head mounted display in use? Or, is it more of a standard to call the static method like this:
_hmd = Ovr.Hmd.Create(Ovr.Hmd.Detect());
If the above code is what I need to use, any advice on using the detect method? It doesn't seem to return the correct integer of the Hmd in use.
Any advice on how to get a reference to the current HMD would be greatly appreciated. My apologies if this has been discussed before.
1 Reply
Replies have been turned off for this discussion
- dignifiedwebExpert ProtegeI came back with fresh eyes and found the solution to my problems.
Here's how I ended up detecting whether the HMD's health and safety warning is displayed:// Detect if health and safety warning is displayed:
if(OVRManager.isHSWDisplayed == false)
{
Debug.Log("Health and safety warning pressed");
}
Thanks to user phileday and his post about that (I knew I should have searched more on the forums don't know how I missed that post).
That lead me to finding out I can get a reference to the HMD by using the OVR Manager too. Here's the code to create a re-center button in case someone is looking for that too:
// Get access to hmd amd re-center:
Ovr.Hmd hmd = OVRManager.capiHmd;
hmd.RecenterPose();
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 months ago
- 11 years ago