How to fix this line of code?

I’ve tried everything, but I cannot fix this line of code:

game.Workspace.Camera.CFrame = CFrame.new(IntroTunnel.CameraOrigin.Position, IntroTunnel.CameraFace.Position)

The IntroTunnel variable:

local IntroTunnel = game.Workspace:FindFirstChild("IntroTunnel")`

The output error says that “CameraOrigin is not a valid member of Model” however it is.

1 Like

Perhaps try waiting for the other parts too? If you’re sure they’re there, it might just be due to them not loading yet:

local IntroTunnel = game.Workspace:FindFirstChild("IntroTunnel")
local CameraOrigin = IntroTunnel:WaitForChild("CameraOrigin")
local CameraFace = IntroTunnel:WaitForChild("CameraFace")
game.Workspace.Camera.CFrame = CFrame.new(CameraOrigin.Position, CameraFace.Position)
2 Likes