POV Camera Manipulation: Looking vertically only works on one-axis? Help?

MouseDeltaY = -input.Delta.Y
tilt = tilt + (MouseDeltaY/20)

local X = math.rad(tilt)
local Y = math.rad(look)

Camera.CameraType = Enum.CameraType.Scriptable
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
Camera.CFrame = ViewPoint * CFrame.Angles(X,Y,0)

Note: this is a sample code, does not include all of the code, but the necessary information

I think it’s because it’s only set to x, and nothing is being worked with on the Z axis. But, how do I make it work great on both the X and Z axis?

1 Like

Try using CFrame.fromOrientation(Y,X,0) instead. I believe it’s the order of operations the angles are being applied to.

2 Likes

Wow, I can’t believe I haven’t seen that before. Thank you!

1 Like

It’s fine I faced the same problem while trying to make a turret system a long time ago. I tried doing the same thing you did :tongue: but yeah now I know more about CFrames so it’s all good now :+1:.

1 Like