You could keep track of both objects' positions. Once they are in a certain range of eachother set one to be the parent of the other and set the child's position so it has the correct offset to appear aligned. Then when you move the parent object the child will move with it.
|