Detecting whether a HMD is in use

When loading my game, I want to select an appropriate character depending on if the player is using an HMD or not. In the editor, this works fine using the IsHeadMountedDisplayEnabled Blueprint node: it returns frue in VR preview and false otherwise. However, it always returns true when packaging the game, or when using a shortcut to UE4Editor.exe with my project file and -game as parameters.

I’ve tried other methods (GEngine->IsStereoscopic3D(), GEngine->HMDDevice->IsStereoEnabled(), GEngine->HMDDevice->IsStereoEnabledOnNextFrame(), GEngine->HMDDevice->DoesAppHaveVRFocus()), but they all return either always true or always false in standalone mode, and these alternatives do not even work properly with PIE, either.

So, what is the proper way to detect whether the game is running on a HMD? I.e. something that returns true when starting using -vr as a parameter or calling “Stereo On” and false otherwise. Or is this behavior a bug in IsHeadMountedDisplayEnabled, since the documentation “Returns whether or not we are currently using the head mounted display.” seems to imply this behavior?

Try to use “Get HMD worn state” to trace when user put on or remove HMD at runtime.
or “Is Head Mounted Display Connected” to trace it on Begin play