PokéRogue
    Preparing search index...

    Provides methods for toggling the sensor state of a Matter.js physics body on a Game Object. A sensor body participates in collision detection and fires collision events, but does not physically react to or push other bodies. This makes sensors ideal for trigger zones, pickup areas, or any situation where you need to detect overlap without causing a physical response. This component is intended to be used as a mixin and not instantiated directly.

    interface Sensor {
        isSensor(): boolean;
        setSensor(value: boolean): this;
    }

    Implemented by

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

      Returns boolean

      true if the body is a sensor, otherwise false.

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

      Parameters

      • value: boolean

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

      Returns this

      This Game Object instance.