Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to not allow the player to rotate the camera?

Asked by
xPolarium 1388 Moderation Voter
9 years ago

So about 3 hours ago I posted a question on how to get the Camera to focus on a certain direction. I was able to figure it out by making the CameraType = "Fixed". Now I have no idea how to stop the player from rotating the camera.

This is what I have in a LOCALSCRIPT:

local cam = workspace.CurrentCamera
local newCam = workspace.Lobby.LobbyCam --This is the Camera  located in Lobby
local focusCam = workspace.Lobby.Focus --This is a part that the Cam focuses on
local plyr = script.Parent
plyr.Humanoid.WalkSpeed = 0
wait()

cam.CameraType = "Fixed"
cam.CoordinateFrame = newCam.CFrame 
cam.CameraSubject = newCam
cam.Focus = focusCam.CFrame


I need help on what needs to be changed if possible and if there's a way to disable mouse rotation/zooming out.

1 answer

Log in to vote
0
Answered by 9 years ago

One way of doing this is setting the player's max and min zoom to a certain amount, however this will not stop rotation.

Another way of doing this is to create a "custom" camera by setting the camera's type to "Scriptable":

cam.CameraType = "Scriptable"

However when you do this, you will need to recode how you want it to work.

Ad

Answer this question