Spawners dont spawn spectating players

Hi, I really need help. I am so frustated, over the past few weeks I have been trying to somehow respawn spectating players at desired player spawners and it simply doesnt work.

I have a verse code that checks for last player alive, when 1 player is left alive and rest died and are now spectating the verse code activates a trigger.

Now, how can I make all players, both alive and spectating players to spawn for new round at desired player spawners? I cant use classic round system because of other things on my map. So I somehow need to respawn them over and over during one round/game session.

I tried: like 20 different verse codes with help of UEFN AI (big mistake, everytime the AI says this will work, then later says that it actually cant work), and I also tried using functions (in Spawner Device functions- Spawn player - Trigger - on triggered)
I checked respawn alive player in all my spawners, so when activated it respawns not only the spectator but also the last player alive. Spawners are enabled and the trigger also works.

When the trigger is activated the last player alive is killed and respawned at random player spawner, but all spectators are still spectating him (not respawning).

I just feel so stupid, surely UEFN has a simple way to respwan spectating/dead players right? This feels like trivial thing.

Please help…Thanks

Hi! I have used one solution for this, but it’s not 100% with spawners because it will not fire the player spawned event to overcome this I add a trigger that “replaces” that event.
I will leave you an example of the code. Hope that helps. Respawn sometimes if it’s called after the player was killed can fail, so i would recommend adding a delay of 1 second at least after the last player is eliminated before calling all the respawns so the last one doesn’t fail.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/FortPlayerUtilities }
respawn_spectators := class(creative_device):
    @editable
    KillTrigger : trigger_device = trigger_device{}

    @editable
    RespawnTrigger : trigger_device = trigger_device{}

    @editable
    SpawnOffset : vector3 = vector3{ X := 0.0, Y := 250.0, Z := 0.0 } 

    @editable
    PlayerSpawner : player_spawner_device = player_spawner_device{}

    @editable
    TimerDevice : timer_device = timer_device{}


    OnBegin<override>():void=
        KillTrigger.TriggeredEvent.Subscribe(OnTrigger)
        TimerDevice.SuccessEvent.Subscribe(OnTimer)

    OnTrigger(MaybeAgent:?agent):void=
        if:
            Agent := MaybeAgent? 
            FortCharacter := Agent.GetFortCharacter[]
        then:
            FortCharacter.Damage(FortCharacter.GetMaxHealth() + FortCharacter.GetMaxShield())#Insta kill the player to make them a spectator

    OnTimer(MaybeAgent:?agent):void=
        for(Player : GetPlayspace().GetPlayers(), Player.IsSpectator[]):#Respawn all spectators
            Player.Respawn(PlayerSpawner.GetTransform().Translation + SpawnOffset,PlayerSpawner.GetTransform().Rotation)
            RespawnTrigger.Trigger(Player)

Yes! Thank you so much. I changed the code a little bit for my map but the base of the code was what I needed. You saved me :slight_smile:

1 Like