OverlapParam Whitelist/Blacklist Not Filtering

Hey! I can’t seem to get my OverlapParam whitelist to work. It will always return 19, despite there only being 3 objects in the grass folder. It returns the same amount if I use a blacklist as well. I don’t know what I’m doing wrong - documentation hasn’t been any help.

wait(5)

local filterObjects = {game.Workspace.Grass}
local params = OverlapParams.new(filterObjects, Enum.RaycastFilterType.Whitelist)

local boundParts = game.Workspace:GetPartBoundsInBox(CFrame.new(0, 0, 0), Vector3.new(100, 100, 100), params)

print(#boundParts)

Thanks for any help!

1 Like

The OverlapParams constructor does not accept any parameters.

local filterObjects = {workspace.Grass}
local params = OverlapParams.new()
params.FilterType = Enum.RaycastFilterType.Whitelist
params.FilterDescendantsInstances = filterObjects

local partsInBox = workspace:GetPartBoundsInBox(CFrame.new(), Vector3.new(100, 100, 100), params)

print(#partsInBox)
3 Likes

Maybe you explain what is GetPartboundsInBox?