Camera only rotates along the Y axis in viewport

I have been trying to create a handheld camcorder that displays what it is seeing on a screen for VR.

For some reason, the camera in the viewport only rotates along the Y axis.

In the script, I set the viewport camera’s CFrame to the CFrame of the camcorder’s lens every frame.

viewportCamera.CFrame = lens.CFrame

If I print the orientation of the lens, it returns the correct value. If I instead print the orientation of the camera, it returns a Vector3 with only the correct Y value, the rest being 0.

I’ve tried setting it to other CFrames like the player’s headset CFrame and it did the same thing.

Why is this happening?

Enable VRTiltAndRollEnabled under the camera and then see if it sets the orientation correctly