Hello! I have been attempting to find the parts that surround a particular part, but every method I have tried has not worked. I considered firing rays in each direction but I couldn't figure that out. What are my options?
✓ ANSWER ACCEPTED
How to find the parts that surround a part?
1 answer
✓ Accepted answer
You could make use of the GetConnectedParts() or the GetTouchingParts() functions. There may also be some other pre-built functions for BaseParts that could be useful to you, I suggest giving this article a look.
3 comments
0
I took a look at these, but the way my project is set up makes it so that all of my parts are adjacent.
0
I created a pseudo-part that surrounds the original part but with its' sides expanded half a stud on each side, and then used GetTouchingParts() and it worked! I will accept this answer. :)
0
Thanks!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
No need for rays. Get a chase script from a zombie, it uses distance to find the nearest humanoid. You can edit it to detect parts surrounding the object.
can I see what you attempted with the rays? Or possibly another alternative may be to do something like a Region3 around the part http://wiki.roblox.com/index.php?title=API:Class/Workspace/FindPartsInRegion3WithWhiteList