Summary
elimination_manager_device events EliminatedEvent and EliminationEvent will not be invoked to re-joining players when respawn limit is set to 1 in Island Settings
This is crucial when working on reload maps, where you want to control how many reloads a player has. By setting the limit to 1 player_spawner_device’s will not respawn eliminated player automatically, from there conditional respawns can be performed using Agent.Respawn
Please select what you are reporting on:
Creative
What Type of Bug are you experiencing?
Assets
Steps to Reproduce
Set
Spawn Limit: 1Join in Progress Behavior: Spawn Immediatly
inIsland Settings
and have the following setup in the island
@editable
EliminationManager : elimination_manager_device = elimination_manager_device{}
# OnBegin - Subscribe to elimination events
EliminationManager.EliminatedEvent.Subscribe(OnEliminatedEvent)
EliminationManager.EliminationEvent.Subscribe(OnEliminationEvent)
# Subscribe to join event
GetPlayspace().PlayerAddedEvent().Subscribe(OnPlayerAdded)
# Add callbacks
OnEliminatedEvent(Agent: agent): void=
Print("GameManager:OnEliminatedEvent")
OnEliminationEvent(Agent: agent): void=
Print("GameManager:OnEliminationEvent")
# Spawn joining players
OnPlayerAdded(Player:player):void=
Print("OnPlayerAdded")
Agent.Respawn(NewTranslation, NewRotation)
When a player joins a lobby the single spawn is exhausted.
if a player leaves the lobby and rejoins
Player Spawners will not respawn the player - which is fine
A manual respawn can be executed Agent.Respawn (via the PlayerAddedEvent)
When the player who rejoined is eliminated, the OnEliminatedEvent will not be invoked for that player.
So to reproduce: join the lobby with 2 players, have one leave and rejoin
once eliminated the rejoined player, the OnEliminationEvent will not be invoked -
Expected Result
Elimination Manager will invoke OnEliminatedEvent
Observed Result
Elimination Manager does not invoke OnEliminatedEvent
Platform(s)
All