nape-js API
    Preparing search index...

    Class TriggerZone

    High-level trigger zone — Unity-style onEnter/onStay/onExit wrapper over the nape callback system.

    Automatically creates sensor-based InteractionListeners and manages their lifecycle. Assign handlers directly or via the constructor options.

    const zone = new TriggerZone(space, sensorBody, {
    onEnter: (other) => console.log("entered!", other),
    onStay: (other) => console.log("inside", other),
    onExit: (other) => console.log("left!", other),
    });

    // Later: clean up all listeners
    zone.dispose();
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    cbType: CbType

    The CbType automatically created for this zone.

    Accessors

    Methods