OverlapParams idk

I would like to make it so all the objects in the enemies folder (and objects added in the future) will be included in the overlap params.

Issue:
It doesn’t really include objects that are added after.

local Params = OverlapParams.new()
Params.FilterType = Enum.RaycastFilterType.Include
Params.FilterDescendantsInstances = workspace.Enemies:GetDescendants()

while task.wait(1) do
	local check = workspace:GetPartsInPart(physicalRange, Params)
	
	print(check)
end

Should I just keep updating this part or is there a better specific way to do it?
Params.FilterDescendantsInstances = workspace.Enemies:GetDescendants()
Or there’s likely something else i’m missing I don’t know I’m tired

yes, you just need to redefine the overlap params within the while loop, so it updates to the latest descendants

2 Likes

I believe you can simply do Params.FilterDescendantsInstances = {workspace.Enemies}. Anything under workspace.Enemies will be included, as they are its descendants, and it would solve the issue too.

1 Like

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