GetPartsInPart() not detecting parts outside of a model

This code does not pick up descendants of the spot folder in workspace, and I’m not sure why. For example, this neon blue part, which is a descendant of Spot, however it is not working at all. I tried moving both the script and RadarBig outside of the model but it still outputs the same results. If I remove the filter parameters then it just outputs some parts that are descendants of the drillrig model, which I don’t understand, as it doesn’t output anything else.
image

drill = workspace.DrillRig
part = drill.Atenna.RadarBig
minimap = drill.Panel.Radar
local params = OverlapParams.new()
params.FilterDescendantsInstances = workspace.Spot:GetChildren()
params.FilterType = Enum.RaycastFilterType.Include
local objectsInSpace = workspace:GetPartsInPart(part,params)
while true do
	wait()
	for i,v in pairs(objectsInSpace) do 
			print(v.Name, "This") 
		end
end

Any help would be greatly appreciated

2 Likes

Currently your scripts will only detect parts which are inside the Spot due to this line here

yes, i want it to do that, however its not detecting them even though ive explicitly whitelisted them

params.FilterDescendantsInstances = {workspace.Spot:GetChildren()}

Try this

nope, still outputting no results

Because GetPartsInPart is executed outside the while loop, it’s only run once. You’re using the same results made by objectsInSpace pre-loop once the code is executed.

Place objectsInPlace in the while loop. I would recommend using a short task.wait() delay because this function may not be performant.

1 Like

This still doesn’t output anything, even when putting objectsinplace in the while loop.