[Solved] How to snap objects to each other

Hey all,

I want to make a game where you lay down tracks in the right order, so the train can ride it, if it’s complete. I was able to rotate the tracks, and be draggebale.
But i don’t know how to snap the object togheter.
What im looking for, is that if you place a track on a open opening on each side. It will snap automatic to the track that is in collision with it (and ofcourse on te good open end)

Note : IN-Game not in the editor.

How can i achieve this?

The snap actions work in-game too, if the grid system is okay for you.

Jeah I think so. The sprites are 100x50 and 50x50. How would I achieve this?

Inspect this example: GDevelop 5