Disable "LookUp" in VR

Hi everyone,

I was wondering if it would be possible to disable “look up” in VR, so that the player can only turn head left to right but if you look up the camera doesn’t move there. I managed to do this very easily in the editor/screen based version, but not in VR…

thanks!

Why would you want to do that in the first place? Any constraint to head movements in VR is very likely to cause discomfort to the player and eventually may lead to dizziness and even cyber-sickness, so I don’t recommend to do that.

This said, there is no real way to constrain the pitch movement of the VR Camera since it is simply linked to the HMD pitch angle in space, however you can always counter rotate the VR Origin (the Scene Component the VR Camera is parented to) to compensate for it. The final effect should be the same.

You can try something like this.

On Event Tick:
GetWorldRotation for the VRCamera. Extract the Pitch angle and invert it ( * -1 ).
SetWorldRotation for the VROrigin and pass X and Z unchanged. Pass the inverted Pitch angle as Y.