Checking for GameObjects within a set distance of another GameObject

Hey guys, I’m trying to find a way of seeing what GameObjects are within the area of other GameObjects.

For Example:
The image below shows four GameObjects. If the user were to click on object A then I’d want them to also click be able to click on Object B & C but not Object D. If they clicked on Object B then they could click on Object A & D but not C.

I have looked into Physics.OverlapSphere but that ends up touching on some of the space that I don’t want the user to be able to touch.

Since the distances are always going to be the same distance apart would I be better off just checking the Vector3 of one object and if it’s within a certain distance then allow the user to continue? In theory the objects on an angle from each other will always be further then the ones to the left, right, top and bottom.

Any help would be greatly appreciated.

Sounds like you’re looking for Vector3.Distance.