Regaining VR Focus After DeviceLost/Acquired In Unity — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Regaining VR Focus After DeviceLost/Acquired In Unity

martin-tmartin-t Posts: 4
NerveGear
edited January 7 in Unity Development
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 
Sign In or Register to comment.