Phaser API Documentation

  Version: 
canCollide(body1, body2)

Description:

Checks if the two given Arcade Physics bodies will collide, or not, based on their collision mask and collision categories.

Parameters:

name type description
body1 Phaser.Types.Physics.Arcade.ArcadeCollider

The first body to check.

body2 Phaser.Types.Physics.Arcade.ArcadeCollider

The second body to check.

Returns:
Description:

True if the two bodies will collide, otherwise false.

Type:
  • boolean
Since: 3.70.0