Camera is not a valid member of Workspace "Workspace"

Hello, i’m making a little cutscene for my game then for some reason i get this error

Here’s my script:

local currentcamera = workspace.CurrentCamera
local camera = workspace.camera
local player = game.Players.LocalPlayer
wait()
currentcamera.CameraType = Enum.CameraType.Scriptable
wait()
currentcamera.CFrame = camera.CFrame

Now, the problem is this script works for my other game but then i add this script to any other game it doesn’t work i get the error: camera is not a valid member of Workspace “Workspace”
And yes the part is in workspace

Thanks.

1 Like

Try doing:

local camera = workspace:WaitForChild(“camera”)

Perhaps the part simply hasn’t loaded yet, so using WaitForChild() will wait for the camera to load in.

3 Likes

This has worked thank you.

Should’ve actually thought about it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.