:GetTagged() doesn't return anything

I’m trying to create an ambience system with the ZonePlus module. I have tagged all the zones with the tag “Zone”. It doesn’t print anything though.

This is in a local script.

for _, Group in pairs(CollectionService:GetTagged("Zone")) do
	print(Group.Name)
	local Zone = ZonePlus.new(Group)
	
	Zone.localPlayerEntered:Connect(function(Player)
		EnterZone(Group)
	end)

	Zone.localPlayerExited:Connect(function(Player)
		
	end)
end
2 Likes

Make sure ALL of the parts are in workspace when you are playing:
-The parts are all anchored
-The parts have CanCollide set to false

Play in Studio and search for the names of the parts that are tagged “Zone” in the Explorer. If they are missing, this is your problem. If you cannot locate them, select Move under Home at the top of Studio and look around.

I thought that would be the last reason why my Zone+ usage wasn’t working, and I was confident my parts were anchored, but they weren’t after 40 minutes of debugging.

2 Likes

Didn’t work. The part is still tagged and it is also anchored.

1 Like

Try running this in the Run a Command box in Studio: (don’t test/play)

for _, Group in pairs(CollectionService:GetTagged("Zone")) do
	print(Group.Name)
end

Look in output and if nothing is printed, there is probably an issue with the tagging itself.
If there is something printed, then there is something in-game that is removing the tags.

Like I said, the part is still tagged. Even when I am testing.

Maybe there’s some sort of infinite yield using :WaitForChild() where you misspelled an instance’s name before using the CollectionService, or there’s an error that you haven’t noticed because you’re using a pcall in a specific way?