Cameratype changes only after waiting 1 sec

I am warming back up into scripting and I am just confused on why changing the cameratype only works if I wait 1 second, I feel like thats a bad idea/habit to get into and is there a real solution? without the wait it will not change the cameratype or cframe.

local camera = game.Workspace.CurrentCamera
local cameraRigs = game.Workspace:WaitForChild("cameras")
local cameraPart = cameraRigs:WaitForChild("cameraPos")

wait(1)

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = cameraPart.CFrame
wait(1)
print(camera.CameraType.Name)
print(camera.CFrame)

This should help:

1 Like

thank you this does help!
It is a little wierd that that is the solution for this, but it works thanks!

1 Like

I believe it’s because the camera CoreScript is changing the CameraType from Fixed to Custom once the player is added, so it overwrites the CameraType you are setting from your script.

Therefore we have to wait until that change is made to then change it back to Scriptable