How can I find a specific Part In a Parts area


im trying to make chess, the board has alot of parts
the left and bottom sides of the board have a index value Like “C” or “5”
i wanna Find the location a square is for example A5 or C7
Im thinking of raycasting from each side of a square to the square next and raycast from that square to the next and repeat until it finds a index value; is this a good option or is there a better suitable method for this?

There are a few ways of doing this,

  1. You could use some math to do this where if a player picks C3, you get the bottom-left most corner and add 3 positions right (C) and 3 positions up.
  2. You can just name all the parts with the correct name place and do BoardParts:FindFirstChild("C7"), though naming will be a bit tedious
  3. If you really want to use IndexValues than you can use a for loop and find the correct part with the correct IndexValue, though I would suggest you use attributes instead of values
for _,part in BoardParts:GetChildren() do
	if part.IndexValue.Value == "C7" then
		-- do something
	end
end
2 Likes

Ty for responding
The first one seems good, would dividing the distance between the left/bottom side and selected square divided by the normal square size work good?

for 3 the attribute Idea is better ill switch to that; also rn the values are only on the corner pieces and not all over the board