How Do I Get All The "Neighbours" Of A Part?

i have queastion
and how can I find neighbors for parts previously found (colored)

If you donā€™t care about the name of the parts, name each their equivalent i in this for loop, then, to find the parts close to it, do something like this:

local Columns = 4 -- should be the number of columns of all the parts
local PartTop = model:FindFirstChild(tostring(tonumber(part.Name)-Columns))
local PartBottom = model:FindFirstChild(tostring(tonumber(part.Name)+Columns))
local PartLeft = model:FindFirstChild(tostring(tonumber(part.Name)-1))
local PartRight = model:FindFirstChild(tostring(tonumber(part.Name)+1))

Like I said previously, this will only work if you do not care about the name of the parts at all and know the exact amount of columns of these parts, if thatā€™s true, then this system will be the best and most efficient way to do it, as itā€™s just basic math and four :FindFirstChild instead of raycasting 4 times (although I donā€™t think raycasting for very short distances would be very inefficient).