How to detect manual player respawn?

Specifically, I’m interested in an event that triggers right away when player ‘respawn’ via menu as I need to destroy the vehicle assigned to that player in case it was jammed somewhere on track. If I try to do that on actual spawn event then player spawns into exploding car…

Without testing, just theory…

You could save logic that detects if a player recieves damage. Reset that logic on spawn.

Filter your code through that logic.

I’m not sure if there is a better way ( since there isn’t a (fort_character).RespawnedEvent() as far as I’m aware), but I just check if the Player is currently active using IsActive[]

# THis loop will begin when the character is eliminated (you can listen to this event via fort_character.EliminatedEvent
    if (FortChar.IsActive[]):
         Print("Player has respawned!")
         # You can do whatever you want after player respawns here

         Print("Fort character is dead / respawning")
# Or you can do it after the loop 
1 Like

You could use a logic variable and conditional statement inside a function that is subscribed to the player spawned event of the spawn pads, When your game loop wants a player to spawn you check that the variable is true (Likely use an [agent]logic map{}, on a per case basis) then set it to false. If it is already false, then they would have spawned manually. In order for this to work the game would need to know when a player is going to be spawned / respawned and set the variable to true.

If you’re having issues placing a respawned player into a vehicle via assign driver of a vehicle device, Then maybe you could respawn the vehicle on player elimination and have the device setup to destroy the existing vehicle. This way you’re destroying it after the fact, not before they are placed in it.

Thanks for ideas, I’ve ended up checking GetFortCharacter.isActive on interval

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.