Collision event

The Collision Event in Game Maker is an event that executes its actions when an object collides with another object specified by the user. The collision is detected using the sprite of the object, or if set, the mask.

The behavior of the Collision Event varies significantly, depending on whether the other object has the solid attribute set.

For a non-solid collision the behavior is as expected.

For a solid collision two extra things occur. The position of the object is returned to its previous location (xprevious, yprevious). After the event ends a further check is made of the location x+xspeed, y+yspeed and if a collision is found at this location then the position is returned to its previous location a second time, with no event.

The second collision check is often counter-intuitive, and has the effect that managing the position using move_contact or similar may appear to have no effect if the object's remaining speed will cause a collision next timestep.