Forum Discussion
PicoPlanetDev
5 years agoProtege
Correct way to pause game when headset removed / Dash up?
Hi! I am working on a VR application and I need to meet VR.PC.Functional.3. I am testing this in a simple Menu Scene I designed, and it only works partially. When I hit the Oculus button to return to ...
rh_galaxy
5 years agoHeroic Explorer
I don't think you should do "OVRCameraRig.SetActive(false);"
I have this in my GameManager Update()...
I have this in my GameManager Update()...
//pause if in oculus home universal menu, and if headset not worn
bool bPauseNow = (!OVRManager.hasInputFocus || !OVRManager.hasVrFocus) /*|| (XRDevice.userPresence!=UserPresenceState.Present)*/;
//pause state change
if (bPause != bPauseNow)
{
bPause = bPauseNow;
if (bPauseNow)
{
Time.timeScale = 0.0f; //stops FixedUpdate
//also need to stop all sound
AudioListener.pause = true;
AudioStateMachine.instance.masterVolume = 0.0f;
}
else
{
Time.timeScale = 1.0f;
AudioListener.pause = false;
AudioStateMachine.instance.masterVolume = 1.35f;
}
}
- victoriascott4 years agoHonored Guest
Hi rh_galaxy,
I'm also failing my VR.PC.Functional.3, VR.PC.Input.2 & VR.PC.Input.3 and Oculus tech pointed me to this page.Your code looks great, however, I am new to State Machines.
How are you declaring bPause and AudioStateMachine? Are these ints or floats? Public or Private?
Thanks so much!
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
- 8 months ago