How can I use whitelist and collision group with OverlapParams?

I couldn’t find any documentation or previous post about specifically about my question. I want to whitelist only the parts that fall under the collision group “Test”. Is this possible?

local Hitbox = script.Parent
local Character = script.Parent.Parent

local Params = OverlapParams.new() --Creating raycast params
Params.FilterDescendantsInstances = {}
Params.FilterType = Enum.RaycastFilterType.Whitelist
Params.CollisionGroup = "Test"

spawn(function() --Spawn function start
	while task.wait() do --While true loop start				
		local parts = workspace:GetPartsInPart(Hitbox,Params)
				
		for i,v in pairs(parts) do
			print(v.Name)			
		end		
	end
end)
1 Like

Change FilterType to Enum.RaycastFilterType.Blacklist
See if that fixes anything.