Forum Discussion
Anonymous
5 years agoMy App Won't Pause When Dash Is Open, Etc.
I created my VR app in Unity 2019.1.4f1 and Oculus plugin 1.36 for the Rift. The build failed the technical tests for VRC.PC.Functional.3 and VRC.PC.Input.2, because the app doesn't pause when the Dash is open. The app does pause when the headset is removed. An Oculus blog addressing common submission issues said that one resolution for these issues would be that "Run in Background" in Unity's Player Settings/Resolution and Presentation should be unchecked, however that's already the case with the build.
I also have a VRC.PC.Input.9 "focus aware" failure. But I didn't think that issue applies to the Rift, because the focus aware feature can only be enabled on the Quest. Do I need to turn off the focus aware feature in my app? If so, how to I do that?
If anyone can provide assistance I would greatly appreciate it.
I also have a VRC.PC.Input.9 "focus aware" failure. But I didn't think that issue applies to the Rift, because the focus aware feature can only be enabled on the Quest. Do I need to turn off the focus aware feature in my app? If so, how to I do that?
If anyone can provide assistance I would greatly appreciate it.
4 Replies
- Jezza3DHonored GuestI'm having exactly the same issue and won't be able to update my game until this is fixed
- AnonymousI just received a support ticket response from Oculus Developer Support, shown below. I'll try this out today. Let's keep our fingers crossed.
Have you referred to the Input Focus sample in the Oculus integration for an example of typical handling for the loss of input focus in an application? The sample can be found in the SampleFramework folder.
Additionally, an example script that you may want to try is the following:using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GamePause : MonoBehaviour
{
[SerializeField] private GameObject pauseObject;
private AudioSource audioSource; // assuming music is attached to this GO
private void OnEnable()
{
OVRManager.HMDUnmounted += PauseGame;
OVRManager.HMDMounted += UnPauseGame;
OVRManager.VrFocusLost += PauseGame;
OVRManager.VrFocusAcquired += UnPauseGame;
audioSource = GetComponent();
}
private void OnDisable()
{
OVRManager.HMDUnmounted -= PauseGame;
OVRManager.HMDMounted -= UnPauseGame;
OVRManager.VrFocusLost -= PauseGame;
OVRManager.VrFocusAcquired -= UnPauseGame;
}
private void PauseGame()
{
if (pauseObject != null)
pauseObject.SetActive(true);
Time.timeScale = 0.0f;
if (audioSource != null)
audioSource.Pause();
}
private void UnPauseGame()
{
if (OVRManager.hasVrFocus)
{
if (pauseObject != null)
pauseObject.SetActive(false);
Time.timeScale = 1.0f;
if (audioSource != null)
audioSource.UnPause();
}
}
} - 360VRBCRHonored Guest
OjosLindos said:
I just received a support ticket response from Oculus Developer Support, shown below. I'll try this out today. Let's keep our fingers crossed.
Have you referred to the Input Focus sample in the Oculus integration for an example of typical handling for the loss of input focus in an application? The sample can be found in the SampleFramework folder.
Additionally, an example script that you may want to try is the following:using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GamePause : MonoBehaviour
{
[SerializeField] private GameObject pauseObject;
private AudioSource audioSource; // assuming music is attached to this GO
private void OnEnable()
{
OVRManager.HMDUnmounted += PauseGame;
OVRManager.HMDMounted += UnPauseGame;
OVRManager.VrFocusLost += PauseGame;
OVRManager.VrFocusAcquired += UnPauseGame;
audioSource = GetComponent();
}
private void OnDisable()
{
OVRManager.HMDUnmounted -= PauseGame;
OVRManager.HMDMounted -= UnPauseGame;
OVRManager.VrFocusLost -= PauseGame;
OVRManager.VrFocusAcquired -= UnPauseGame;
}
private void PauseGame()
{
if (pauseObject != null)
pauseObject.SetActive(true);
Time.timeScale = 0.0f;
if (audioSource != null)
audioSource.Pause();
}
private void UnPauseGame()
{
if (OVRManager.hasVrFocus)
{
if (pauseObject != null)
pauseObject.SetActive(false);
Time.timeScale = 1.0f;
if (audioSource != null)
audioSource.UnPause();
}
}
}HI, YOU COULD SOLVE IT? - AnonymousThe code provided by Oculus dev support which I copied in my Apr. 17 post unfortunately didn't work, so they gave me the link below to another forum post; the fairly simple code at the bottom of the post seems to have worked. Today I'm going to upload a new build which uses it and see if it passes the Oculus tech test. Here's the link to the forum post:
https://forums.oculusvr.com/developer/discussion/63733/how-do-i-correctly-implement-vr-focus-with-unity-to-pass-vrc-pc-input-1
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
- 7 years ago
- 2 years agoAnonymous
- 10 months ago