snap object to object in game mode

i have 2 objects in my game. How can i snap one to another when the distance between them is less then a certain value? Again, this is in play mode, not in the editor.

I’d suggest adding a child object with a trigger collider that is the size that you would like them to go ahead and snap together, when they enter trigger find the edges and either split the difference moving them together or force one to go towards bigger one etc.