I want to ignore groups of parts when raycasting. Currently the solution is either to use CollisionGroups but they are limited to 32 per game so it’s very limited, or to use a single table that you have to manually manage, which is tedious and inefficient
If RaycastParams.FilterDescendantsInstances accepted subtables, it would make managing groups of parts much easier
local GlassParts = {workspace.Glass1, workspace.Glass2}
local Player1Hitbox = workspace.Character1.Hitbox:GetChildren()
local Player2Hitbox = workspace.Character2.Hitbox:GetChildren()
local Options = RaycastParams.new()
Options.FilterType = Enum.RaycastFilterType.Blacklist
Options.FilterDescendantsInstances = {GlassParts, {Player1Hitbox, Player2Hitbox}}
You can implement a builder pattern that automates this. You can also use this in combination with table.clear to always re-use the same table to construct the ignore lists in too.
One reason not to do this is that the behavior would be very confusing with getting FilterDescendantsInstances:
Options.FilterDescendantsInstances = {GlassParts, {Player1Hitbox, Player2Hitbox}}
print(Options.FilterDescendantsInstances) --> ...is now a flat list?
I do not think it would be confusing at all. There would be 2 types allowed, table and Instance so you can just assume that all tables are groups of instances
Alternatively, making it possible to ignore parts with a CollectionService tag would make ignoring groups of parts easier
This will likely be implemented at some point. Adding support for collision groups to RaycastParams was just a first step in extending how you can filter things.