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:
trueif the body is a sensor, otherwisefalse.- 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 valueboolean trueto set the body as a sensor, orfalseto disable it.- Since: 3.0.0
- Source: src/physics/matter-js/components/Sensor.js (Line 15)
Returns:
This Game Object.
