Phaser API Documentation

  Version: 
Event: OVERLAP
Phaser.Physics.Arcade.Events.OVERLAP
OVERLAP

Description:

The Arcade Physics World Overlap Event.

This event is dispatched by an Arcade Physics World instance if two bodies overlap and at least one of them has their onOverlap property set to true.

It provides an alternative means to handling overlap events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('overlap', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:

name type description
gameObject1 Phaser.GameObjects.GameObject

The first Game Object involved in the overlap. This is the parent of body1.

gameObject2 Phaser.GameObjects.GameObject

The second Game Object involved in the overlap. This is the parent of body2.

body1 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The first Physics Body involved in the overlap.

body2 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The second Physics Body involved in the overlap.

Since: 3.0.0