Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Sensor
Phaser.Physics.Matter.Components.Sensor

Methods

setSensor(value)
Focus
Focus

Description:

Set the body belonging to this Game Object to be a sensor. Sensors trigger collision events, but don't react with colliding body physically.

Parameters:

name type description
value boolean

true to set the body as a sensor, or false to disable it.

Returns:
Description:

This Game Object.

Examples:
Since: 3.0.0
Focus
Focus
isSensor()
Focus
Focus

Description:

Is the body belonging to this Game Object a sensor or not?

Returns:
Description:

true if the body is a sensor, otherwise false.

Type:
  • boolean
Examples:
Since: 3.0.0
Focus
Focus