I’m trying to create a pause menu when the VR headset is not worn inside my game. I want this UI to overlay everything like a normal UI would in any other game. I can get this to work by calling EnableStereo no as a console command but, as soon as I do that I lose the worn state of the HMD because it has been turned off… and then I can’t turn it back on when it changes worn states.
I essentially have to turn off the HMD in order to see the UI because of the way Unreal handles UI when it is turned on. Is there a way to either:
A. Get the worn state while it is disabled?
OR
B. A way to pause the stereo display of the VR without turning off the HMD.
(I’ve tried vr.bEnableStereo on/off and it essentially does the same thing as what I am doing now)
OR
C. Regain focus of the HMD headset after it is disabled
Edit: Essentially, what I’ve noticed is that it looks like the app is losing focus all together for some reason. Unsure why. (i.e. I can move the mouse outside of the application window.) The CheckForHMD bool is only true when a particular level has finished loading. I’ve debugged the HMDWornState and it returns NotWorn no matter what I do after Stereo is disabled.
I use this as workaround and it works even with GoogleVR plugin disabled, but it’s only related to gyro info to keep gyro look when stereo rendering is off.
Apparently it doesn’t work for Oculus either. But, unfortunately I am just a piece of a much larger project and cannot revert to an older engine so that isn’t an option for me.
So I figured out this problem on accident trying something else. If you call the node Show Splash Screen, it will give focus back to the VR headset and Unreal will continue to get the HMDWornState. Then you should just check if the user is wearing the headset or not and hide the splash screen when it is worn. With stereo disabled, the splash screen is only visible when wearing the headset, but if you turn it off as soon as you are wearing it you never see it, so win win for me haha. I think however, you also need to set the splash screen each time as well after hiding it. There are a few kinks with using this and just to be safe I always call hide splash screen before I show it.
I haven’t tested whether or not that it still continues to get the gyro data on anything else but, I can at least keep the app in focus on the Oculus even with the stereo turned off using this method. Essentially, when I was doing this before the Oculus would lose focus of the app. This way the app continues to run and I’m able to get the WornState of the device.