CurrentCamera CFrame not setting

The cframe of CurrentCamera does not set even though scripted to.

Part of the script related:

local plr = game.Players.LocalPlayer

local char = plr.Character or plr.CharacterAdded:Wait()

local cam = workspace.CurrentCamera

repeat

cam.CameraType = Enum.CameraType.Scriptable

until cam.CameraType == Enum.CameraType.Scriptable

print('test 1')

cam.CFrame = workspace.IntroCam.CFrame

print('test 2')

workspace.CurrentCamera.CFrame = workspace.IntroCam.CFrame

[Sorry about the formatting, devforum is acting weird]

“test 1” and “test 2” prints in the output, there are no errors.

seems like the script is loading in too fast
try adding

local waitforpart = char:WaitForChild('HumanoidRootPart');

right after the local char = …