Declaration
public void OnStateChanged(Action<AvatarStateType oldState, AvatarStateType newState> callback)
Parameter
oldState | The player's previous state type. |
newState | The player's current state type. |
Descriptions
This event fires when the state of the player is changed.
local player = ParaPlayerService.GetLocalPlayer()
player:OnStateChanged(function(stateOld, stateNew)
print(stateOld)
print(stateNew)
end)
player:ChangeState(AvatarStateType.Dead)