Skip to main content

on

Listen for proximity action triggered events.

Syntax

proximityAction.on(callback);

Parameters

NameTypeDescription
callback(event: ProximityActionEvent) => voidCallback when a proximity action is triggered.

Returns

  • (event: ProximityActionEvent) => void - The callback function.

Example

const proximityAction = engine.world.createProximityAction();

proximityAction.on(event => {
console.log('Proximity action triggered!', event);
});

Available on: Client