I am creating a system that restricts access to certain areas using collision groups. A part which fills the space of the restricted area is added to a collision group, group A, and players who should be able to access that area are also added to group A. Collision groups outside of group A can collide with it, so any player not within group A will collide with the part and not be able to enter. However, I need players to be able to access multiple such areas.
My first idea was to add multiple collision groups to a player, however that is not possible, as parts can only be members of one collision group. So, I came up with the idea of a tiered system wherein there exist multiple collision groups which have a hierarchical relation with one another. For example, take groups A, B, and C, A being the lowest level of access and C being the highest. Players within group A can only access areas restricted by group A. Players in group B can access areas restricted by group B and group A. Players in group C can access areas restricted by all groups A, B, and C.
This system requires collision settings between the groups which appear to be impossible to set. For example, objects in group A must collide with objects in group B, however objects in group B must not collide with objects in group A. This relation requires the collisions between the two groups to be able to be set independently, which is not possible. If group A collides with group B, group B collides with group A. As seemingly a limitation of collision groups, this hierarchical architecture appears to be impossible to create due to this issue.
I could control these collisions on the client, and set CanCollide to false if the player should have access, however I want to be able to create these at runtime, not only statically defined, so being able to create collision groups in this manner is important. Additionally, players can use exploits to get into the area, thus requiring me to verify that the player should actually have access to whatever they are interacting with inside of the area on the server before continuing with the interaction (a seemingly avoidable check). Additionally, with Server Authority being released soon I suspect that this solution will become obsolete, as players within parts they should not be will just be set back.
Any suggestions on how to fix this issue or create such a relation between the groups is appreciated.