It's a "Portal Gun" system.
A simple example in its logic, but rather difficult to do ...
This example is not perfect.
Update coming soon, fix bugs.
#configkeys
Mouse.Left.Click <> Portal A
Mouse.Right.Click <> Portal B
Source : www.gamemaker3d.com/player?pid=04502423663