I would like to have a camera that can only be moved horizontally, and not up-and-down.
The script that I have tested is working but overrides when the camera is on a cutscene, it also glitches a bit when the player tries to move the camera vertically.
Here is the script:
function Camera()
local x,y,z = cam.CFrame:ToEulerAnglesXYZ()
cam.CFrame = CFrame.new(cam.CFrame.Position) * CFrame.Angles(0,y,0)
end
runService.RenderStepped:Connect(Camera)
Also, will it be correct to use the CurrentCamera? Or are there better options?
I do not have much idea in scripting, so every response is appreciated. Thank you!
The glitching is caused because the default camera scripts are updating the y position before you are resetting it, causing a slight jitter. I can provide a better script but before that, could you specify whether the camera is in fp or third person?
The camera is in 3rd person, but can be zoomed into first person because the player can freely move it. I just want to limit their camera movement from up and down.