Hi, I’m currently struggling with some issues when using collection service, perhaps I’m not understanding some basics. For example, I have two parts in my workspace named FlagPole tagged as “Flag”. A red Flag and a blue Flag.
However if I run the following:
for i,flag in pairs(collectionService:GetTagged(“Flag”)) do
it finds a total of 6 instances of FlagPole tagged as “Flag”. I can even check explorer when this is happening and confirm only two flagpole’s exist in the workspace- there’s no cloning or anything.
I have assigned each of those flagpole Parts to a variable and then add that variable as part of an array, it seems like collection service is then considering those as separate instances?
i.e.
local objectives = {blueFlag, redFlag}
If I run that loop now collection service says 4 flagpoles. If I pass that objective array into a function then collection service finds 6 flags now…
I thought assigning a variable to a part would just essentially make a pointer and not a separate instance??