OverlapParams not detecting part (HELP!)

Hello I’m trying to detect a part using GetPartBoundsInRadius with an OverlapParam that checks for collision group, but nothing is being detected even though there’s clearly a part with the “Projectile” group at the position.

Code:

local params = OverlapParams.new()
params.MaxParts = 1
params.CollisionGroup = "Projectile"
params.FilterType = Enum.RaycastFilterType.Include

local objects = workspace:GetPartBoundsInRadius(Vector3.new(1300, 67, 100),10,params)
print(objects)

image

Projectile with visual radius:

2 Likes

If you are confused that the print outputs the memory address of the table, make sure you have “log mode” disabled in the output. You can disable it in the three dots in the top right corner of the outpur window.

2 Likes

Small caveat here in the documentation

Specifies a collision group for the raycasting operation. Parts in collision groups that are set to not collide with this group are ignored (<-- THIS). If this property is omitted, the raycast assumes the Default collision group.

Source: RaycastParams | Documentation - Roblox Creator Hub

2 Likes

(Might not be the source of your problem, but I think this is something to make sure of!)

2 Likes

You’ve set your params to only look at objects within the included list, but did not include a list. I’ve not tested this personally but I would think that means nothing will ever be returned. Either remove this Include or add where the part you want to find is within the filter list

3 Likes

This was part of the issue too thanks

For some reason I thought FilterType would include any objects that match the properties in the OverlapParam, is there any way I could only look for parts with the collision group “Projectile” without adding a list?

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