We are making a video playing application for the GearVR that relies on pausing the video if the headset is removed and playing when the headset is put back on. To make resetting the state of the video player easier, we are reloading the scene when the video finishes or when the user presses the back button.
However, the head mounting detection only works when the application is first loaded, and upon reloading the level the head mounting detection stops working. We've narrowed it down to either the Oculus plugin, or how Unity handles action mapping. We were just wondering if anyone else is having this issue or if anyone has a fix for it.
We are using Unity 5.6 and Oculus Utilities 1.13 and plugin 1.12 and have encountered the same issue on Oculus Utilities 1.12. We are unable to downgrade to Unity 5.5 because of our reliance on specific functions of the new native video player.
Answer by Codest19
Apr 18 at 05:35 AM
I also have this issue. Can't detect player unmounting gear. I have it trying in the second scene in my game. Using Unity 5.6 and ovr 1.13. I've also noticed it doesn't call OnApplicationPause or OnApplicationQuit when taking off the gear and pulling out the phone. I need to save my game at that point obviously. Have you found a solution in the past few days?
Answer by BodhiPurplePill
5 days ago
Try OVRManager's booleans "isUserPresent" or "hasVRFocus"
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
127 People are following this question.
Unity 5.4.0f3 Oculus SDK2 Not working
Unity 5.6.0f3 Oculus rift crash when removed from the head when build
Checking if canvas world space is visible in CenterEyeAnchor?
Developing for VR and Multiple Platforms