Namespace: Sensor

Phaser.Physics.Matter.Components. Sensor

Enables a Matter-enabled Game Object to be a sensor. Should be used as a mixin and not directly.

Since: 3.0.0
Source: src/physics/matter-js/components/Sensor.js (Line 7)

Methods


isSensor()

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

Since: 3.0.0
Source: src/physics/matter-js/components/Sensor.js (Line 33)
Returns:

true if the body is a sensor, otherwise false.

Type
boolean

setSensor(value)

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.

Since: 3.0.0
Source: src/physics/matter-js/components/Sensor.js (Line 15)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject