Params only ignore the first value in the table?

So basically I have a module that makes params for a script.
Only problem is that I have a table that ignores the characters children, and a folders children.
But it is ignoring the first item(Which is the characters children)

How do I make it ignore all the things?

function module.charIgnoreParams(char)
	local params = RaycastParams.new()
	
	local ignoreItems = {char:GetChildren(),workspace.Effects:GetChildren()} -- it is ignoring the second set of things, or the folders children

	params.FilterDescendantsInstances = {ignoreItems}
	params.IgnoreWater = true
	params.FilterType = Enum.RaycastFilterType.Blacklist
	
	
	return params
end

I think the issue is that you’re putting a table within a table.

ignoreItems is already a table itself. When you call
params.FilterDescendantsInstances = {ignoreItems} you’re putting the table inside of another table.

Try this instead:
params.FilterDescendantsInstances = ignoreItems

Still, same thing.
Its only ignoring the stuff in the character.

The :GetChildren() method also creates a new table of instances. If I recall correctly, you should be able to just pass in the instances (without specifying the children of those instances) into the property. Luau will automatically filter the descendants of the passed in instances.

Instead of
local ignoreItems = {char:GetChildren(),workspace.Effects:GetChildren()}

Try
local ignoreItems = {char, workspace.Effects}

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.