Adding the ability for rays to ignore parts with certain tags will make it so I don’t have to manually manage a list of every object I want to ignore
local RayOptions = RaycastParams.new()
RayOptions.IgnoreTags = {"Water", "Glass", "ModelHitbox"}
Adding the ability for rays to ignore parts with certain tags will make it so I don’t have to manually manage a list of every object I want to ignore
local RayOptions = RaycastParams.new()
RayOptions.IgnoreTags = {"Water", "Glass", "ModelHitbox"}
You can probably accomplish this using the CollisionGroup field of RaycastParams. If it must be automated and dynamic, you can probably route all tag changes through a module that adds or removes instances from a no-raycast collision group at the same time.
If this is insufficient for your use cases, you should explain in more detail.
You can only have 32 collision groups in a game iirc, supporting tags is more scalable
I recently ran into this issue as well, raycasting to whitelist a bunch of enemies so I can detect specifically what I should damage. I would greatly appreciate using tags to ignore or whitelist by providing a table of all the tag names. My current work around is looping all the parts and moving them to a proxy table which I then supply to the Raycast Params. I would love to have an optional parameter to RaycastParams for tags!