Reliable way of detecting nearby parts?

Hello again, DevForums! I am still currently finding a way of automatically getting anchor points for my web swinging system, and I started to believe that my current system does not work due properly to not having a reliable way of detecting nearby parts. Would there be a way to detect a part near the player?

https://developer.roblox.com/en-us/api-reference/function/Player/DistanceFromCharacter

Than you for this! Would I just check every part’s distance using i v in pairs now?

for _, part in ipairs(folder) do
	local distance = player:DistanceFromCharacter(part.Position)
	if distance <= 10 then
		--Do code.
	end
end

Yeah, here’s an example snippet.

The distance units are in studs, so 10 represents 10 studs.

Ok, thank you! I will try this when I can and I will let you know how it goes!