Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you make it so the camera cant move more than 5 studs?

So i wanna make it where the camera can't move more than 5 stud's, Basically you can move 1 stud 2 stud 3 stud 4 stud 5 stud Then your camera is lock unless you move backwards like 4 stud 3 stud 2 ect

Super simplified (I want it so you can only rotate your camera a little to the right and a little to the left thanks.)

My attempt

while wait() do
if workspace.CurrentCamera.CFrame.LookVector == CFrame.new(-0.462089419, 0.00836229138, -0.886793852) then
workspace.CurrentCamera.CFrame = CFrame.new(-0.462089419, 0.00836229138, -0.886793852)
end
end

What this should do is check if the camera's look vector is atleast 5 stud's away then if it is it constantly set's it to that point unless they move it back this is so hard help please!

1 answer

This is very easy. Just go into starterplayer, then look for the option, "CameraMaxZoomDistance". It should be 128 studs, change it to 5 studs. Done, no coding! Hope this helps, bye! :D

This discussion is preserved as it was. New answers, comments, and votes are closed.