SetControlRotation & HMD On broken (DK2)

The SetControlRotation Command is executed, but the VR Camera switches 1 Frame later to its origin rotation.
HMD Off works just fine!

  • Take a new default 1st Person Template
  • Add a simple TriggerBox to the level (hidden in game: off)
  • Add the following code to the level BP

Start Preview with hmd off / simple viedport and walk into the TriggerBox: Everything works as expected. The player faces the desired rotation.

Start VR Preview:
As soon as the Player walks into the TriggerBox the view changes for 1 Frame to the new direction, but instantly switches back to its origin.

I put this in different locations like: a new Actor BP, the Char BP or a function.
But norhing changes this behavior. VR Off works, VR On doesn’t

It seems to me, as if the command isn’t allowed to change the VR Cameras yaw.
If I set “Follow HMD Orrientation” to on, everything works fine.

If “Follow HMD Orrientation” is set to True, so the camera is independent from my character
I walk through to Triggerbox and get correct rotated, even with hmd on. But as soon as I switch back to “Follow HMD Orrientation” => False, the camera moves back to the wrong angle.

Tested in 4.9.0 & 4.9.1

Any help on “How to rotate the hmd” is welcome! Tryed many different approaches, but got nothing to work :confused:

I am a big fan of BluePrints and a VR developer. I would love for a solution to this issue. My current workarounds are not ideal, and the bug is crippling for development.

I can confirm this bug in 4.8 as well as 4.9

Looking forward to a fix! In terms of possibilities it would be like strapping a rocket onto the roof of a car!

Hey nn23-

Based on the setup you’ve provided I’ve entered a bug (UE-21676) to investigate this issue.

Cheers

We are having the same problem here.
A fix for this issue would be extremely important for us.

Problem still exists in UE 4.10.1 :frowning:

Has someone found a good workaround?

Yes, please fix this. I am using the flying template and I never know at what position my pawn will spawn in on. This is extremely confusing to the user in VR.

any update on this one ?

Hey -

The bug report associated with this issue is currently still open and unresolved in our database. I’ve added to the report that this is still affecting people and will comment here when there is an update to the status of the issue.

Hey , I know your team is working hard to constantly make Unreal more awesome-and so I want to reiterate the importance of fixing this issue. For my team this is a must-fix, and we’re fast approaching the Oculus Rift release date. I can also confirm the same issues in UE4.10.

I see the problem. The issue is that Control Rotation is basically ignored when you are in VR mode and being replaced by the HMD one (+ delta). I am trying to come up with a simple solution that wouldn’t require any changes in existing interfaces (meaning, can be integrated into upcoming 4.11 (and backport into 4.10, hopefully); otherwise you’ll have to wait till 4.12, which is pretty long time to wait).
I’ll let you know once I have anything usable.

Awesome to hear that, thank you, thank you, thank you!

Ok. Bad news: there is no easy fix possible. Good news: there is a workaround.
Unfortunately, SetControlRotation is very crappy function. It is used by many ‘clients’: mouse, keyboard, HMD, user. It is impossible to distinguish the user-called SetControlRotation from other, internal calls.
Thus, the initial set of the control rotation is just ignored by HMD and HMD overrides it.
The only solution I see is to separate internal calls to SetControlRotation from the user-level calls. But it will involve serious re-design of UE core and it is not gonna happen now.

However, there is a workaround. You may use Oculus Function Library, method SetBaseRotationAndBaseOffset (InMeters or not - doesn’t matter, we use only rotation part of it).

So, instead (or in addition to) of setting SetControlRotation set the base rotation of HMD. Note, the rotator from GetControlRotation should be inverted.
One more note: if you need to make it work at startup (like on the screenshot), you’ll need to modify OculusFunctionLibrary.cpp, methods SetBaseRotationAndPositionOffset / SetBaseRotationAndPositionOffsetInMeters: you should remove the “GEngine->HMDDevice->IsHeadTrackingAllowed()” condition from the “if”-statement there (this fix will be in 4.11, hopefully).

I suppose, we need to discuss this issue with Epic guys and decide what to do in long term, since this solution will work only for Oculus (Rift / GearVR). And another suggestion: in 4.11, the Camera Component will have a property ‘Lock to HMD’, meaning it will follow HMD orientation/position and this should be the main way how you work with VR in UE. The PlayerController-“automatic VR” is just for drop-any-project-in-and-run-in-VR-effortlessly kind of things, it is not good once you need to do something fancier than just look around in HMD.

Thank you for digging so deep into this issue, this helps a lot!

I’ll go and use SetBaseRotationAndBaseOffset instead!

Thanks again for your help!

Hello hello, I am also having the same issue with my project version 4.12 but its my rotation and position.