Optional options: PlayerEventOptionsCalled once per player when they go away — mirroring the threshold of the matching
onEnterScene. With the default requireProfile, that means either the player
left or their avatar profile went away; with { requireProfile: false }, only when
their identity is gone.
Do not rely on getPlayer(userId) here — what it returns depends on which threshold
fired. On the identity threshold the entity is gone and it returns null; on the default
threshold it can still return a live player, because only the avatar profile went away
while the identity is still present. The last known state therefore arrives as the second
argument, and is the only reading that is correct in both cases.
an unsubscribe function
Called once per player when they go away — mirroring the threshold of the matching onEnterScene. With the default
requireProfile, that means either the player left or their avatar profile went away; with{ requireProfile: false }, only when their identity is gone.Do not rely on
getPlayer(userId)here — what it returns depends on which threshold fired. On the identity threshold the entity is gone and it returns null; on the default threshold it can still return a live player, because only the avatar profile went away while the identity is still present. The last known state therefore arrives as the second argument, and is the only reading that is correct in both cases.Returns
an unsubscribe function