Restricting User from Dragging Camera?

Hi! I’m working on a camera button, and I’ve gotten it to lock onto an object, but, the user can still drag their mouse. How can I restrict the movement? Here’s my code.

local cam = workspace.CurrentCamera
local target = workspace.TargetOne

cam.Focus = CFrame.new(-11.3, 7.2, -36.31)
cam.CameraType = Enum.CameraType.Fixed
cam.CoordinateFrame=CFrame.new(5.555, 6.081, -25.864)
cam.CameraSubject = target

Changing the camera type to Enum.CameraType.Scriptable will give players no direct ability to modify the camera. Setting the camera type to this implies that scripts should be in control of the camera.

You can read an example usage at the bottom of this Roblox Wiki article.

Hope this helps! :grin:

That works, but when I do it, the camera takes up an entirely different angle than before Hmmm

1 Like

I did it! I just adjusted the angles, thank you so much.

1 Like