The code I use for my script is this:
if uis:IsKeyDown(Enum.KeyCode.D) then
camrot *= CFrame.Angles(0,math.rad(1),0)
end
if uis:IsKeyDown(Enum.KeyCode.A) then
camrot *= CFrame.Angles(0,math.rad(-1),0)
end
if uis:IsKeyDown(Enum.KeyCode.W) then
camrot *= CFrame.Angles(math.rad(1),0,0)
end
if uis:IsKeyDown(Enum.KeyCode.S) then
camrot *= CFrame.Angles(math.rad(-1),0,0)
end
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = hr.CFrame*camrot*CFrame.new(0,0,camzoom)
And when I print the eularangles of camrot, the Z axis changes and it starts moving the camera sideways. How would I fix this?