Blocking camera control

I want to avoid player from controlling the camera, also avoid it to try to have the camera subject focused on the center of the screen, why?

In the game I’m working on, we want to have a camera that moves to a different CFrame when pressing the buttons of the menu at the side of the screen, so we need the camera only to move when players presses a button, and the CFrame of the camera is tweened, when this happens, after the tween completes it goes back to the player, and if I set a subject in front of where it ends tweening, the player can still move the camera.

When setting the camera type to Scriptable, it just gives a warn and goes as usual.

Hello, can I see what warning do you get?

Active camera controller didn’t select a module

Ok, do you want to block camera when player joins the game, right?

Indeed, right away, the cam CFrame will be set in a specific place after loading screen goes away (Custom one)

Try to do:

repeat 
   workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
   wait()
until workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable```

Mmmm that’s silly tbh and will cause a lot of lag, also break the camera

Why would cause the lag and break it?

Repeating things that fast related to camera, will make it glitchy, I’m sure theres a better way

You can escape scripting simply just by editing “StarterPlayer”

You can use RunService to update it every single frame before it will become scriptable.

Similar to what @OwOshka said -

Using a LocalScript in StarterPlayerScripts you can use:

local Camera = game:GetService("Workspace"):WaitForChild("Camera")
if Camera ~= nil then
    for Focus = 1,5 do
    Camera.CameraType = enum.CameraType.Scriptable
    -- Camera.CFrame = whatever
wait()
    end
end

I want to tween the CFrame, my problem is player can control the camera and I want it to be forced to move it pressing buttons

If you make the CameraType ‘Scriptable’ then the Player cannot control it.

I got it!, ure right but I need to set the zoom distance to .5 on max and min, also set camera subject to something on the same CFrame i got tweened to

Or you can set the Camera’s CFrame?

So like -

local Point1 = Part.CFrame
Camera.CFrame = Point1

Will move abruply so no, also just realized the player can still take camera control

Nvm, just realized that I need to set it right after setting the subject is set

Preset Camera.rbxl (41.2 KB)

I threw a little something together for you to mess around with Camera values.

1 Like

it is rbxl not rbxm, how to use it?