Hi. I've made a script that when the ball (which you can push around) touches the green part, it makes the obstacle course that is invisible , become visible. This is the code.

local gPart = workspace.GreenPart
local sphere = workspace.Ball


gPart.Touched:Connect(function(touchingPart)
	
	if touchingPart.Name == "Ball" then
		
		for i, v in ipairs(workspace.Obby:GetChildren()) do
			
			if v:IsA("Part") then
				
				v.Transparency = 0
				v.CanCollide = true
				
				
			end
			
		end
		
	end
	
end)

What it tells me in the output: Obby is not a valid member of Workspace " Workspace "

Not sure how this is happening, but somehow the " Obby " model disappears when I click play?

If you can help, please do. I am a beginner scripter from the Philippines, and I'm looking forward to improving and getting better.

4 comments

0

Are you sure that Obby is in the workspace? You could've placed it in a folder in the workspace or somewhere else

0

Yes I am sure I placed it in the workspace.

0

did you anchored the obby model?

0

I can't believe the solution was that simple. I appreciate your help Puppynniko