Camera Not Working

I got nothing to say except

 Players.rusted010101.PlayerGui.Main:4: attempt to index nil with 'CFrame'  -  Client - Main:4
  18:47:34.050  Stack Begin  -  Studio
  18:47:34.050  Script 'Players.rusted010101.PlayerGui.Main', Line 4  -  Studio - Main:4
  18:47:34.050  Stack End  -  Studio

heres the script

local camera = game.Workspace.CurrentCamera

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = game.Workspace.Scene:FindFirstChild("CameraPart").CFrame or wait()
game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart").Anchored = true

wait(10)

camera.CameraType = Enum.CameraType.Follow
game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart").Anchored = false
1 Like

try WaitForChild. The CameraPart probably didn’t load in because of StreamingEnabled.

camera.CFrame = game.Workspace.Scene:WaitForChild("CameraPart").CFrame
1 Like

this doesnt really do anything, i suggest using :WaitForChild() instead and also removing the wait() because it doesnt do anything