Camera doesn't stay "scriptable" after i sent it to be scriptable

In the name. I set my camera to scriptable with code, but it doesn’t stay scriptable and goes back to custom.

local camera = game.Workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
print(camera.CameraType)
wait(5)
camera.CFrame = workspace.loadingCameraLocationPart.CFrame 
print(camera.CameraType)

Output

Enum.CameraType.Scriptable  
Enum.CameraType.Custom
1 Like

The script works perfectly fine for me, are you changing the camera type in another script?
also make sure it’s a local script not server script.

Its a local script under starter player. So it is weird that it works for you and not me

Put it in the StarterCharacterScripts.
It should work

1 Like

From testing, i think the camera type resets when the character loads?

Yup, That’s true if you want to keep using it in StarterPlayerScripts then add a Cooldown like 3 seconds.

for StarterCharacterscripts you don’t have to add any cooldown
Also Please use task.wait() instead of wait() it’s better and wait() is now deprecated task.wait() is also faster than wait()

1 Like

I didn’t know wait was deprecated. Ill try startercharacterscripts

1 Like

try this

local Player = game:GetService("Players").LocalPlayer
local camera = game.workspace.CurrentCamera

repeat wait()
	camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable

camera.CFrame = game.workspace.loadingCameraLocationPart.CFrame 
3 Likes

i put it in starter character scripts and it looks like i works now

2 Likes