Game is not a valid member of Datamodel "Untitled Game"

I have been searching for a solution, but no luck…

So I made a simple script that tweens the camera from one part to another four seconds after the player has loaded. But after testing it, this error popped up…


My code: ```lua
local currentcamera = game.Workspace.CurrentCamera
local campart1 =
local campart2 = game.Workspace.Cameras.cam2

currentcamera.CameraType = Enum.CameraType.Scriptable
currentcamera.CFrame = campart1.CFrame

repeat wait(1) until game:IsLoaded()


local tweenservice = game:GetService(“TweenService”)

tweenservice:Create(currentcamera,, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {
CFrame = campart2.CFrame

I think this is a Roblox issue.

You have “” in your second variable, remove the extra “game”

1 Like

change this

local campart1 =

to this

local campart1 = game.Workspace.Cameras.cam1

or just do the post above me


Thanks, forgot to catch that issue!

But I have this new error.

Which makes no sense because Cameras IS a valid member of workspace

This is because the Cameras folder hasn’t replicated yet, since your script is running before anything replicates, since its in ReplicatedFirst, you should use a :WaitForChild() call to wait for Cameras to replicate/load in.

Anything in ReplicatedFirst gets loaded in before anything else.