How to know object standing next to another object in script?

hi everybody!
I’m creating a game like XOX game.
how to make player win the game with 5 X in one line

you can decide what “next to” means, like how far that would be, then check the distance of the two objects to see if they are in range. its a Vector3.Distance(transform,transform); type operation if my memory serves me. The 2 transforms being the objects location that you are testing for.