Get HMDWornState doesn't work when Stereo is disabled?

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.

If you need to keep the gyro look in non-VR view, there’s a blueprint workaround for it through “Get Input Motion State” node.

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.

It worked flawlessly in 4.19 on all devices, i’ve seen some reports it breaks down in 4.20+ on moto G5, for example. https://answers.unrealengine.com/questions/787556/getinputmotionstate-returning-all-0-values-for-som.html
Try just blank project on older versions of engine, not sure if it’s a bug that’s been there, or introduced in newer UE version.

Unfortunately, it seems that the HMD is disabled when you disable the stereo rendering so you can’t even get any of that information. Found a thread talking about the same issue: GetHMDWornState stops working when used to toggle stereo rendering - XR Development - Unreal Engine Forums

GetPlayerController → GetInputMotionState returns 0,0,0 for every field even with the above code disabled just printing it every tick.

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.

Bump for visibility

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.

So you’re getting gyro data from GoogleVR plugin with stereo off also? If so, that’s awesome!

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.