Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Checking if there is a part at a position?

I want to know if there's a function or method to find if there is a part at a given position. I know you could create a part and check if it's touching anything, but that seems inefficient. Any ideas?

2 comments

0

+1 cause you're an amazing soul and accepted mah answer

0

+1

1 answer

✓ Accepted answer

You can use Region3.

Use the Region3.new constructor to create your region. Use the FindPartsInRegion3 function of workspace to get any object located inside of it.

Example;

local region = Region3.new(Vector3.new(0,0,0),Vector3.new(10,10,10))
local parts = workspace:FindPartsInRegion3(region)

for _,v in next,parts do
	print(v:GetFullName())
end

This discussion is preserved as it was. New answers, comments, and votes are closed.