How can I disable camera controls?

I’m trying to not let the player move the camera at all.I know that the controls module exposes a method that disables the key controls, but when I try the same thing with the camera module it says attempt to call a nil value.
Here’s my script:

local Player = game.Players.LocalPlayer
local PlayerScripts = Player.PlayerScripts
local PlayerModule = PlayerScripts:WaitForChild("PlayerModule")
local CameraControls = require(PlayerModule):GetCameras()
local KeyControls = require(PlayerModule):GetControls()
KeyControls:Disable()
CameraControls:Disable()

The only problem with this is that last line.

4 Likes

Would setting the CameraType of the camera to Scriptable do the trick?

For some reason no, I can still scroll in and out

Maybe :Controls() didn’t return anything? Try to printing it.

Nevermind, turns out changing the camera’s cameratype to scriptable does disable the camera controls, I just did it wrong.

Change the CameraType to scriptable and make the CameraMaxZoomDistance and the CameraMinimumZoomDistance the same.