EarthBack is not a valid member of Workspace "Workspace"

Error in the title!

Hello! Ive been getting this error on every single of my tweenscripts that i made and its unbearable, i tried :Wait(), I tried :WaitForChild(“Name Here”) But Nothing Works!

I cant seem to find a fix so im gonna need help from someone with making this script work

Heres the error again:

16:50:14.517 EarthBack is not a valid member of Workspace "Workspace" - Client - PlayerCutscene:17

IT ERRORS EVERY SINGLE LINE WITH THE FUNCTION!

Heres the code

> local cam = workspace.CurrentCamera
> local camPart = workspace.Lobby["CameraPart2"] or wait()
> 
> local ts = game.TweenService
> local ti = TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false, 0)
> local goals = {
> 	
> 	CFrame = game.Workspace.Lobby.CameraPart2.CFrame
> 	
> }
> local goals2 = {
> 
> 	CFrame = game.Workspace.Lobby.CameraPart1.CFrame
> 
> }
> local ToMenuEarth = game.Workspace.EarthTo or game.Workspace:WaitForChild("EarthTo")   -- ERROR USUALLY AROUND HERE
> local BackMenuEarth = game.Workspace.EarthBack or game.Workspace:WaitForChild("EarthBack")
> local goalsmenuEarth = {
> 
> 	CFrame = ToMenuEarth.CFrame
> 
> }
> 
> local goalsmenuEarthback = {
> 
> 	CFrame = BackMenuEarth.CFrame
> 
> }
> local ToMenuMoon = game.Workspace.MoonTo or game.Workspace:WaitForChild("MoonTo")
> local BackMenuMoon = game.Workspace.MoonBack or game.Workspace:WaitForChild("MoonBack")
> local goalsmenuMoon = {
> 
> 	CFrame = ToMenuMoon.CFrame
> 
> }
> 
> local goalsmenuMoonback = {
> 
> 	CFrame = BackMenuMoon.CFrame
> 
> }
> 
> 
> local GuiButtonTo1 = game.Workspace.GuiButtonTo.GuiButton1 or game.Workspace.GuiButtonTo:WaitForChild("GuiButton1")
> local GuiButtonBack1 = game.Workspace.GuiButtonBack.GuiButton1 or game.Workspace.GuiButtonBack:WaitForChild("GuiButton1")
> local GuiButtonToGoals1 = {
> 
> 	CFrame = GuiButtonTo1.CFrame
> 
> }
> 
> local GuiButtonBackGoals1 = {
> 
> 	CFrame = GuiButtonBack1.CFrame
> 
> }
> local GuiButtonTo2 = game.Workspace.GuiButtonTo.GuiButton2 or game.Workspace.GuiButtonTo:WaitForChild("GuiButton2")
> local GuiButtonBack2 = game.Workspace.GuiButtonBack.GuiButton2 or game.Workspace.GuiButtonBack:WaitForChild("GuiButton2")
> local GuiButtonToGoals2 = {
> 
> 	CFrame = GuiButtonTo2.CFrame
> 
> }
> 
> local GuiButtonBackGoals2 = {
> 
> 	CFrame = GuiButtonBack2.CFrame
> 
> }
> local GuiButtonTo3 = game.Workspace.GuiButtonTo.GuiButton3 or game.Workspace.GuiButtonTo.GuiButton3:WaitForChild("GuiButton3")
> local GuiButtonBack3 = game.Workspace.GuiButtonBack.GuiButton2 or game.Workspace.GuiButtonBack.GuiButton3:WaitForChild("GuiButton3")
> local GuiButtonToGoals3 = {
> 
> 	CFrame = GuiButtonTo3.CFrame
> 
> }
> 
> local GuiButtonBackGoals3 = {
> 
> 	CFrame = GuiButtonBack3.CFrame
> 
> }
> 
> 
> 
> 
> local tween = ts:Create(cam, ti, goals)
> local tweenback = ts:Create(cam, ti, goals2)
> 
> local tweenmenuEarth = ts:Create(game.Workspace.Menu.Earth, ti, goalsmenuEarth)
> local tweenmenubackEarth = ts:Create(game.Workspace.Menu.Earth, ti, goalsmenuEarthback)
> 
> local tweenmenuMoon = ts:Create(game.Workspace.Menu.Moon, ti, goalsmenuMoon)
> local tweenmenubackMoon = ts:Create(game.Workspace.Menu.Moon, ti, goalsmenuMoonback)
> 
> local tweenguibuttonto1 = ts:Create(game.Workspace.Menu.Earth.GuiButton1, ti, GuiButtonToGoals1)
> local tweenguibuttonback1 = ts:Create(game.Workspace.Menu.Earth.GuiButton1, ti, GuiButtonBack1)
> local tweenguibuttonto2 = ts:Create(game.Workspace.Menu.Earth.GuiButton2, ti, GuiButtonToGoals2)
> local tweenguibuttonback2 = ts:Create(game.Workspace.Menu.Earth.GuiButton2, ti, GuiButtonBack2)
> local tweenguibuttonto3 = ts:Create(game.Workspace.Menu.Earth.GuiButton3, ti, GuiButtonToGoals3)
> local tweenguibuttonback3 = ts:Create(game.Workspace.Menu.Earth.GuiButton3, ti, GuiButtonBack3)
> 
> local proccesing = false
> 
> if proccesing == false then
> game.ReplicatedStorage.CameraEventON.OnClientEvent:Connect(function()
> 	
> 		script.Parent.PlayerCamera.Disabled = true
> 		
> 		proccesing = true
> 
> 		tween:Play()
> 		
> 		tweenmenuEarth:Play()
> 		tweenmenuMoon:Play()
> 		
> 		tweenguibuttonto1:Play()
> 		tweenguibuttonto2:Play()
> 		tweenguibuttonto3:Play()
> 		
> 		tween.Completed:Connect(function()
> 			script.Parent.PlayerCamera.Enabled = false
> 			proccesing = false
> 		end)
> 	
> end)
> 
> game.ReplicatedStorage.CameraEventOFF.OnClientEvent:Connect(function()
> 	
> 	script.Parent.PlayerCamera.Enabled = false
> 	
> 		tweenback:Play()
> 		tweenmenubackEarth:Play()
> 		tweenmenubackMoon:Play()
> 		
> 		tweenguibuttonback1:Play()
> 		tweenguibuttonback2:Play()
> 		tweenguibuttonback3:Play()
> 		proccesing = true
> 
> 	tweenback.Completed:Connect(function()
> 			script.Parent.PlayerCamera.Enabled = true
> 			proccesing = false
> 	end)
> 
> 	end)
> end
1 Like

Check if the EarthBack instance is correctly named and parented. It often happens with typos.

it is, but now i kinda fixed it BUT NOW IT SAYS UNABLE TO CAST TO Dictionary

i kinda went bad at fixing





repeat until game.Loaded

wait()


local cam = workspace.CurrentCamera
local camPart = workspace.Lobby["CameraPart2"] or wait()

local ts = game.TweenService
local ti = TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false, 0)
local goals = {
	
	CFrame = game.Workspace.Lobby.CameraPart2.CFrame
	
}
local goals2 = {

	CFrame = game.Workspace.Lobby.CameraPart1.CFrame

}
local ToMenuEarth = game.Workspace.EarthTo
local BackMenuEarth = game.Workspace.EarthBack
local goalsmenuEarth = {

	CFrame = ToMenuEarth.CFrame

}

local goalsmenuEarthback = {

	CFrame = BackMenuEarth.CFrame

}
local ToMenuMoon = game.Workspace.MoonTo
local BackMenuMoon = game.Workspace.MoonBack
local goalsmenuMoon = {

	CFrame = ToMenuMoon.CFrame

}

local goalsmenuMoonback = {

	CFrame = BackMenuMoon.CFrame

}


local GuiButtonTo1 = game.Workspace.GuiButtonTo.GuiButton1
local GuiButtonBack1 = game.Workspace.GuiButtonBack.GuiButton1 
local GuiButtonToGoals1 = {

	CFrame = GuiButtonTo1.CFrame

}

local GuiButtonBackGoals1 = {

	CFrame = GuiButtonBack1.CFrame

}
local GuiButtonTo2 = game.Workspace.GuiButtonTo.GuiButton2 
local GuiButtonBack2 = game.Workspace.GuiButtonBack.GuiButton2 
local GuiButtonToGoals2 = {

	CFrame = GuiButtonTo2.CFrame

}

local GuiButtonBackGoals2 = {

	CFrame = GuiButtonBack2.CFrame

}
local GuiButtonTo3 = game.Workspace.GuiButtonTo.GuiButton3 
local GuiButtonBack3 = game.Workspace.GuiButtonBack.GuiButton2 
local GuiButtonToGoals3 = {

	CFrame = GuiButtonTo3.CFrame

}

local GuiButtonBackGoals3 = {

	CFrame = GuiButtonBack3.CFrame

}




local tween = ts:Create(cam, ti, goals)
local tweenback = ts:Create(cam, ti, goals2)

local tweenmenuEarth = ts:Create(game.Workspace.Menu.Earth, ti, goalsmenuEarth)
local tweenmenubackEarth = ts:Create(game.Workspace.Menu.Earth, ti, goalsmenuEarthback)

local tweenmenuMoon = ts:Create(game.Workspace.Menu.Moon, ti, goalsmenuMoon)
local tweenmenubackMoon = ts:Create(game.Workspace.Menu.Moon, ti, goalsmenuMoonback)

local tweenguibuttonto1 = ts:Create(game.Workspace.Menu.Earth.GuiButton1, ti, GuiButtonToGoals1)
local tweenguibuttonback1 = ts:Create(game.Workspace.Menu.Earth.GuiButton1, ti, GuiButtonBack1)
local tweenguibuttonto2 = ts:Create(game.Workspace.Menu.Earth.GuiButton2, ti, GuiButtonToGoals2)
local tweenguibuttonback2 = ts:Create(game.Workspace.Menu.Earth.GuiButton2, ti, GuiButtonBack2)
local tweenguibuttonto3 = ts:Create(game.Workspace.Menu.Earth.GuiButton3, ti, GuiButtonToGoals3)
local tweenguibuttonback3 = ts:Create(game.Workspace.Menu.Earth.GuiButton3, ti, GuiButtonBack3)

local proccesing = false

if proccesing == false then
game.ReplicatedStorage.CameraEventON.OnClientEvent:Connect(function()
	
		script.Parent.PlayerCamera.Disabled = true
		
		proccesing = true

		tween:Play()
		
		tweenmenuEarth:Play()
		tweenmenuMoon:Play()
		
		tweenguibuttonto1:Play()
		tweenguibuttonto2:Play()
		tweenguibuttonto3:Play()
		
		tween.Completed:Connect(function()
			script.Parent.PlayerCamera.Enabled = false
			proccesing = false
		end)
	
end)

game.ReplicatedStorage.CameraEventOFF.OnClientEvent:Connect(function()
	
	script.Parent.PlayerCamera.Enabled = false
	
		tweenback:Play()
		tweenmenubackEarth:Play()
		tweenmenubackMoon:Play()
		
		tweenguibuttonback1:Play()
		tweenguibuttonback2:Play()
		tweenguibuttonback3:Play()
		proccesing = true

	tweenback.Completed:Connect(function()
			script.Parent.PlayerCamera.Enabled = true
			proccesing = false
	end)

	end)
end

I have no idea which line it impacts, but it’s most likely one of the instances being the wrong type. Additionally, I am not certain if these things are BaseParts or GuiObjects?

i fixed it, the parts just didint load yet and i misspelled the tweens goals