MAJOR Agent.Respawn breaks character behaviour

Summary

When in a downed and calling Agent.Respawn will bug the character, the player can then shoot and build while knocked. If this player is revived then the health will not be 30 but will show 0 shield and HP until damaged. When damaged it will show 100HP in green decaying every second by 2 as if knocked.

Another variant of this bug can be caused by double respawning all players. Like this:

RespawnAgents<public>():void={
        AllAgents := GetAllAgents()
        for(I -> Agent:AllAgents):
            if(FC := Agent.GetFortCharacter[]):
                SleepTime := if(I = 0){0.1}else{0.0}
                spawn{RespawnAgent(Agent, ?Delay := SleepTime)}
    }
    RespawnAgent<public>(Agent:agent,?Delay:float = 0.0)<suspends>:void={
        if(Delay > 0.0):
            Sleep(Delay)
            
        if(Temp := Mod[SpawnPadPointer+1,ChannelDevices.Length]){set SpawnPadPointer = Temp}
        SpawnIndex := SpawnPadPointer
        if(CD := ChannelDevices[SpawnPadPointer]):
            if(FC := Agent.GetFortCharacter[]):
                var Loc:vector3=CD.GetTransform().Translation
                set Loc.Z += 300.0
                InfSpawnClass.ChangeClass(Agent)
                Sleep(0.0)
                
                if(FC.IsActive[]):
                    Args : damage_args = damage_args{
                        Instigator := false,      # No player responsible
                        Source := false,          # No external source
                        Amount := 1000.0
                    }
                    #FC.SetVulnerability(true)
                    FC.Damage(Args)
                    Sleep(0.0)

                if(Agent.GetFortCharacter[]):
                    Agent.Respawn(Loc,FC.GetViewRotation())
                    CD.Transmit(option{Agent})
        Sleep(2.5)
        Class1.ChangeClass(Agent)
        if(FC := Agent.GetFortCharacter[]):
            FC.SetVulnerability(true)
    }

When calling this, then knocking the player the player will be in the normal DBNO state. Only after exactly 10s after the respawn code above was called the player will then enter the same bugged DBNO state with pickaxe out being able to build.
Due to class switching the player may become invicible in this case.

Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

Character

Steps to Reproduce

  1. Create a hello_world_device.verse file.
  2. Paste the code in additinal notes
  3. In UEFN press compile verse
  4. Place down the hello_world_device from the content browser
  5. Place down 2 button devices
  6. Select hello_world_device in the world and bind the 2 buttons to it.
  7. Place down a third player spawner.
  8. Start the game
  9. Press the button that puts the players in team 1 and 2 (I do this so we can put 2 players in the same team to display DBNO state)
  10. The player that pressed the button pickaxes another player to DBNO them
  11. Press the other button that calls Agent.Respawn

Expected Result

The player cannot shoot or build when knocked

Observed Result

The player can shoot and build when knocked

Platform(s)

PC

Island Code

6570-5231-1418

Video

Additional Notes

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Characters }
using { /Fortnite.com/FortPlayerUtilities }

team_manager := class(creative_device):
@editable Button1:button_device = button_device{}
@editable Button2:button_device = button_device{}

OnBegin<override>()<suspends>:void={
    Button1.InteractedWithEvent.Subscribe(B1)
    Button2.InteractedWithEvent.Subscribe(B2)
        
}
B1(_A:agent):void={
    for(Agent:Self.GetPlayspace().GetPlayers()):
        if(_A = Agent):
            SetTeam(Agent, 2)
        else:
            SetTeam(Agent, 1)
}
B2(_A:agent):void={
    RespawnAgents()
}

RespawnAgents<public>():void={
    for(I -> Agent:Self.GetPlayspace().GetPlayers()):
        if(FC := Agent.GetFortCharacter[]):
            Agent.Respawn(FC.GetTransform().Translation,FC.GetViewRotation())
}
# Set team for an agent
SetTeam<public>(Agent:agent,TeamNumber:int):void={
    TeamCollection := Self.GetPlayspace().GetTeamCollection()
    
    if(Team := TeamCollection.GetTeams()[TeamNumber-1]):
        if(TeamCollection.AddToTeam[Agent, Team]){}
}

DBNO pov

FORT-1053014 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.