cancel
Showing results for 
Search instead for 
Did you mean: 

Regaining VR Focus After DeviceLost/Acquired In Unity

martin-t
Honored Guest
Hi,

is there a way to programatically set VR focus back to our application? Currently when a device is lost (i.e. user unplugs cable) and is acquired again (i.e. user plugs the cable back in), Oculus Dash is displayed and I can switch back to the application using a controller. The application correctly handles recycling of the device and everything is running as expected. The issue is that normally user does not have a controller available (the application is an arena-scale LBVR experience, tracked by Optitrack) and the only way to get rid of the Dash is to restart the whole application, which is obviously problematic.

The application runs on Unity 2018.1.1 and the latest Oculus plugin/SDK. I'm aware of the Unity-related Dash and focus resources 
https://developer.oculus.com/documentation/unity/latest/concepts/unity-dash/
https://developer.oculus.com/documentation/unity/latest/concepts/unity-lifecycle/
however they describe how to detect and adjust to when a focus is lost, rather than how to completely recover from it and resume playing.

According to the documentation, this should be possible in the native library (https://developer.oculus.com/documentation/pcsdk/latest/concepts/dg-vr-focus/), however the managed API in Unity (OVRPlugin and OVRManager) is somewhat limited and doesn't seem to contain any way of completely reinitializing the device and/or setting focus back to my application.

Is there a way how to do it in Unity? Perhaps writing a native plugin?

Thanks,

Martin 
1 REPLY 1

skymeson
Honored Guest
Having the same issue. For me InputFocusLost is called when using a HTC Vive, and I don't have any issues when testing with Oculus. Oculus Integration is supposed to be cross platform and support Open VR so I suspect this is a bug. I found a workaround but it requires me to modify Oculus scripts which is not a great solution. It would be nice if Oculus could resolve this soon.