Phaser API Documentation

  Version: 
collider(object1, object2, [collideCallback], [processCallback], [callbackContext])

Description:

Creates a new Arcade Physics Collider object.

Parameters:

name type arguments description
object1 Phaser.GameObjects.GameObject | Array.<Phaser.GameObjects.GameObject> | Phaser.GameObjects.Group | Array.<Phaser.GameObjects.Group>

The first object to check for collision.

object2 Phaser.GameObjects.GameObject | Array.<Phaser.GameObjects.GameObject> | Phaser.GameObjects.Group | Array.<Phaser.GameObjects.Group>

The second object to check for collision.

collideCallback ArcadePhysicsCallback <optional>

The callback to invoke when the two objects collide.

processCallback ArcadePhysicsCallback <optional>

The callback to invoke when the two objects collide. Must return a boolean.

callbackContext * <optional>

The scope in which to call the callbacks.

Returns:
Description:

The Collider that was created.

Since: 3.0.0