4.11 VR Camera - Lock to HMD - Broken First Person VR

The new Lock to HMD functionality of the new Camera Component seems great. It allows me to know where the camera’s location is without doing some math. It also lets me attach objects to the camera without doing math on tick. This is great, but it’s also totally ruining my First Person VR.

For first person VR: I add a scene root, attach a camera, and check User Pawn Control Rotation as suggested in the new docs. Unfortunately, this makes for completely vomit inducing VR. Now when I turn my head, my camera turns with a relative offset to my player pawn as it turns - the offset is based on my HMD’s tracked location.

Am I doing something wrong?

Thanks in advance!

I ran into this, as well.

The problem was that the automatic HMD tracking stuff didn’t take into account the rotation of the pawn. If your pawn is rotated in any axis (most likely yaw from your player spawner being rotated in the level) then you’ll end up with the HMD tracking axes being misaligned.

Just make sure your camera component’s parent component is always aligned with the world axes and you should be okay.

In the likely event that you need to rotate the pawn (for seated experiences, for example) I posted a fix as part of a bug report on this issue here.

The easiest thing to do for now would be to make your own CameraComponent which extends the basic CameraComponent, and override the broken GetCameraView function with one that includes the fix above.

Blockquote
Just make sure your camera component’s parent component is always aligned with the world axes and you should be okay.
Blockquote

How do I do that?
I have the problem in my fps bp in VR. I need the lock functionality in order to navigate UMG buttons using head movement.

You just don’t rotate anything which the camera component is attached to. What version of the engine are you using, though? I’d have thought they’d have fixed this by now.

I looked up the bug which was filed when I reported this issue in the bug reports category (Unreal Engine Issues and Bug Tracker (UE-29579)) and it’s been marked as “by design” which seems… odd… but also means this isn’t likely to get fixed. (That said, the bug based on my report doesn’t do a very good job of describing the issue)

I posted a code change which fixes this problem above. Given that the fix was made by messing with the late update code for the camera it might have other negative effects, though, especially since that change predates ansynch spacewarp.

I’m using the latest version 4.15.2. The problem of misalignment starts when I rotate using my controller, then stand still and move my head fw/bw or bend it. I’ll check my camera settings this week and get back to you. Thanks for the update.