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

How can I make it so a player can't rotate their camera?

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?

2 answers

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

2 comments

0

Thank you!

0

Glad I could help! Make sure to accept my answer :)

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