[Bug][4.11] IsHeadMountedDisplayEnabled always returns true in editor mode

Hello,

As of 4.11.1 the Blueprint function IsHeadMountedDisplayEnabled is apparently broken.
According to the documentation:

Returns whether or not we are currently using the head mounted display.

Yet when playing in editor viewport, it returns true even in non VR mode. In standalone mode I don’t reproduce the problem.

A similar bug was already reported last year in version 4.9:

Needless to say, IsHeadMountedDisplayEnabled is quite on the critical side of the spectrum when it comes to VR development…

Hello Julien Guertault,

I was not able to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide detailed list of steps to reproduce this issue on our end?
  3. Was the project that is being tested upgraded form an older version of the engine?

Hi ,

The problem seems to be a little more tricky than my original description suggests. I created a minimal repro case to demonstrate it.

My setup is UE 4.11.1 on a Windows 7 64b. I have the Oculus 1.3 installed, but never completed the setup because my tracking device is not recognized. This means I cannot try VR applications at the moment (all I would see is the Oculus setup scene). I don’t know if this could be the reason the API calls return wrong values.

To reproduce the bug I followed the following steps:

  1. Create a new empty project in UE 4.11.1, with all default options.
  2. Edit the level Blueprint and add a function on the Event tick, so it prints a string (A) if IsPlayerControllerFollowHmdEnabled returns true, and another string (B) if IsHeadMountedDisplayEnabled returns true.
  3. Play in “Selected viewport”.

This is the behavior I observe:

  • No matter what, string A is always displayed.
  • At first string B is not displayed.
  • If I go to Editor Preferences > Level Editor > Play and check Viewport Gets HMDControl, then string B is displayed when playing in the viewport.

According to their documentation (tooltip in the Blueprint editor, and comment in IOculusLibraryPlugin.h and HeadMountedDisplayFunctionLibrary.h):

  • IsPlayerControllerFollowHmdEnabled: “Returns true if PlayerController follows HMD orientation/position. False, otherwise.”
  • IsHeadMountedDisplayEnabled: “Returns whether or not we are currently using the head mounted display.”

Given those descriptions, I would expect in my tests IsHeadMountedDisplayEnabled to always return false (at no point did I render the scene on the HMD), and IsPlayerControllerFollowHmdEnabled to either always return false, or at most return true when Viewport Gets HMDControl is checked.

After looking into this issue further. I believe that this is working as intended. If you set the Viewport Gets HMDControl to true, this will return false if the head set is turned off and it will return true if the head set is turned on. These were the results of the test after following your instructions above. I believe this to be the intended functionality of this setting because when the head set is on and the Viewport Gets HMDControl is set to true I am able to move the camera with the head set. This shows that the HMD is enabled and being used. I hope that this information helps.

Make it a great day

I must have misunderstood the intent then. Thanks for the answer.