Whats the point of collection service?

Whats the point of collection service when I can just make one big folder for everything I want to have a specific effect and do this:

local folder = script.Parent

for i,v in pairs(folder:GetChildren()) do
   if v.ClassName ~= "Script" then
      --do thing here, i guess.
   end
end

I don’t know if I missed something, or if I’m being stupid but it just seems pointless to me.

It’s for like easy organization.

You don’t have to keep everything in one folder, you can have them in anything and all you gotta do is add a tag to them

And you can have multiple tags for even more customization

2 Likes

I’m using collection service to group together map components that I want the player and projectiles to collide with.

1 Like

There is instances where you cannot use a Folder. For example, if you tag an item that was not rendered on the client, ie, in ServerStorage, you will have two seperate folders, on on client and one on server to keep track of the same items. Collection service allows us to treat all objects of the type as one single collection. This way server can access all tagged objects of that type anywhere, and client can access all tagged types on client.

2 Likes

That’s a good point, also same with @Doomcolp 's point prior. Thanks. Can’t mark both as solutions, though, so I’ll just make yours as the solution because it covers something less face-value.

1 Like

Another use case is attachments where you cant put it in one big folder as it has to be parented to a part or terrain.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.