Documentation should note that reading FilterDescendantsInstances returns a copy

local Params = OverlapParams.new()
Params.FilterDescendantsInstances[1] = workspace.Terrain
print(Params.FilterDescendantsInstances)

You might notice that this prints {} instead of {[1] = Terrain}. This is because apparently OverlapParams and RaycastParams will return a copy of their table when you try to read FilterDescendantsInstances. I feel this should be noted in the documentation since this prevents you from assigning values directly to indices of FilterDescendantsInstances and instead you need to assign a new table altogether to FilterDescendantsInstances.

4 Likes

You need to use AddToFilter(). But yes, this could go pretty ugly for someone debugging their scripts and wondering why the part isnt added to the filter.