on
Listen for proximity action triggered events.
Syntax
proximityAction.on(callback);
Parameters
Name | Type | Description |
---|---|---|
callback | (event: ProximityActionEvent) => void | Callback 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