So I have a script that locks the player's camera to a part:
while wait() do game.Workspace.CurrentCamera.CameraSubject = workspace.camerapart end
and I have the min/max camera distance set at 10, but the player is still able to rotate the camera using the right click. So, how can I make it so a player can't rotate their camera?
The best way to disable this is setting Camera's type to Scriptable
. Player won't be able to move it and buttons such as "o", "i" won't work (Normally these buttons works as zoom out and zoom in). Sadly setting Camera's subject like that won't work. You will have to use CFrame
.
while wait() do game.Workspace.CurrentCamera.CFrame = workspace.camerapart.CFrame -- CFrame end
You can also use the event .RenderStepped if you want to keep a certain CameraType other than 'Scriptable'.
http://wiki.roblox.com/index.php?title=API:Class/RunService/RenderStepped