There are two primary techniques that most Construct 2 games will use to handle collisions in their game: "On Collision" or "Is Overlapping + Trigger Once". Developers should take into account the pros and cons of both systems when deciding which one to implement.










On Collision







Overlap + Trigger Once


Triggers Once Per Object Type / Family


Using Overlap + Trigger Once, you may run into a situation where the the original object overlaps a second object while still having already overlapped the first one earlier in time. When this happens, Overlap + Trigger Once will fail to trigger. This limitation can get exacerbated if you make use of families: Obj1 Overlap Family + Trigger Once.

For example, you have a Farmer object, and a Fruit Family which consists of three different objects Apple, Oranges, and Caimitos.

Your collision routine is:
Farmer Overlap FruitFamily + Trigger Once --> Spray the fruit with pesticide. (the fruit remains)

Here is a situation that might occur:
  1. Farmer is walking quickly through the garden
  2. Farmer overlaps an Apple
  3. Overlap triggers and fruit is sprayed.
  4. Farmer sprite is fairly large and overlaps an Orange


Since the farmer is still overlapping a FruitFamily (the apple), the overlap event will not be triggered.
So basically, the overlap will NOT trigger again until the farmer is not overlapping *ANY* FruitFamily objects. On collision does not have this limitation.

Remember
  • "On Overlap + Trigger Once" keeps track at a per-Object Type/Family Level.
  • "On Collision" keeps track at a per-UID level. (one of the reasons that Overlap can be more performant)

Multiple Overlapping Target Objects


If a source object's collision box overlaps two or more objects in the same tick, the SOL will include all instances of the overlap. If there is a possibility of this occurring in game, the developer will need to include a for-each statement in the following manner:

MultipleSimultOverlap.png