onStateChange
This event is triggered when a player's state changes.
Parameters
Name | Type | Description |
---|---|---|
newState | PlayerState | The new state of the player |
oldState | PlayerState | The previous state of the player |
Example
engine.localPlayer.events.on('onStateChange', (newState, oldState) => {
console.log('State changed: New state:', newState, 'Old state:', oldState);
});
Available on: Client