I need the application to keep running at all times, even when the user takes off the headset. I haven’t found an option to disable the automatic pause in either the native VR support or Oculus’ OVR plugin - has someone else who has the same requirements found a way of doing this (which does not include taping the proximity sensor), perhaps?
Yes, how do you do this?
Anyone find a solution to this?
Very interested in a possible solution too. At the moment it seems to also mess up the microphone input in Unity when the game world get paused.
Looking for the same, but I guess tape is our best friend here… :-/
The Rift will still pause when the HMD has been stationary for some time, so even tape is no good. This is such a basic thing to expose in Unity though, it’s high time it makes it in.
Hello, if anyone is still facing this problem, you might try enabling the “Run in Background” in unity player settings. It will cause the game to continue, however the VR camera will not render (black screen).
https://forum.unity3d.com/threads/unity-doesnt-run-in-background-when-removing-oculus-headset.412492/?_ga=1.7793972.720459159.1487322719
If, like me, you only want to show a video when no one is using, this might work for you.
If you download the Oculus SDK and browse around in the Unity sample application, you can find the code that does what you want, and trace it back to the specific DllImport function in the OVR plugin that needs to be called. Don’t worry, Unity already provides the DLL for you, so you don’t need to jump through extra hoops to support this.
Example:
[DllImport(“OVRPlugin”, CallingConvention = CallingConvention.Cdecl)]
public static extern Bool ovrp_SetAppIgnoreVrFocus(Bool value);
You can do the same for directly checking if the sensor sees that the user is present or not by using this:
[DllImport(“OVRPlugin”, CallingConvention = CallingConvention.Cdecl)]
public static extern uint ovrp_GetStatus2(uint query);
where query is an enum value that maps to Status.UserPresent. This is the enum that’s been copied from the SDK code:
private enum Status
{
Debug = 0,
HSWVisible,
PositionSupported,
PositionTracked,
PowerSaving,
Initialized,
HMDPresent,
UserPresent,
HasVrFocus,
ShouldQuit,
ShouldRecenter,
ShouldRecreateDistortionWindow,
}