If I don't remove this from a collision group when it's destroyed, will it cause problems...?

When you add player folders into the game, you create a folder when the player joins, and delete it as the player is leaving the game. This is to remove the residue of a player folder behind and possibly cause issues.

If I wanted to add players to a collision group when they join, do I also have to remove them when they leave? Or will it automatically do this since the part(s) added to the collision group no longer exist in the game?

1 Like

Yes, They’ll be garbage collected from memory, since CollisionGroups are builtin they won’t hold a reference and the items can be garbage collected.

2 Likes

What does “garbage collection” mean in this context? Just automatically removed, meaning no problems?

When you :Destroy() something, you don’t actually remove everything. It just removes all references and connections to the object. This is then completely wiped from by lua’s builtin Garbage Collector later on by its own process.

Yes

THANK YOU SO MUCH I WAS ABOUT TO TEAR MY HAIR OUT (bgdy seems unclear error filler blah blah.)