I’ve read some posts about people trying to figure out how to add multiple collision groups to the Raycast, but I realized that this isn’t possible and I haven’t found any possible work arounds yet so if anyone can help me it would be greatly appreciated.
Here’s my dilemma:
So I have set all invisible parts to their own CollisionGroup so raycasts fired from weapons ignores them as long as the CollisionGroup is set to default.
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = {Character}
params.CollisionGroup = 'Default'
Another raycast though is needed to hit SOME invisible parts, and some VISIBLE ones as well.
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = {Character}
params.CollisionGroup = 'Invis'
This code won’t work though because the ray will ignore all visible parts and only hit invisible ones, vise versa.
How would I go about making one ray ignore invisible parts while another ray recognizes invisible parts?
This would be a lot simpler if we were allowed to set multiple CollisionGroups in the RaycastParams like this:
params.CollisionGroup = {'Default', 'Invis')