[BUG] Casting Instigator to agent is broken

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Summary

Casting an Instigator to Agent is broken. (im working in npc_behavior_script_device). I was following the NPC medic tutorial on the forums, and tried using the line from the tutorial at Understanding NPC Behavior in Unreal Editor for Fortnite | Fortnite Documentation | Epic Developer Community , under the header “NPC States and Verse”. The OnDamaged method includes a case in it’s if statement THAT DOES NOT WORK. Specifically this line. InstigatingAgent := agent[Instigator?]. Currently you must use Instigator.GetInstigatorAgent for the agent to be returned as expected. Im not sure if this is because I am getting my damage_result from an Await() statement, but it’s only the cast to agent from game_instigator that seems to be broken.

Steps to Reproduce

Heres my code.. “navigating” never prints, but “Start navigating to the InstigatingAgent” does print.

BeginChaseIfDamaged():void=
if (Ag := GetAgent):
if (fc := Ag.GetFortCharacter):
dmg_result := fc.DamagedEvent().Await()
Print(“NPC TOOK DAMAGE, BEGIN CHASE”)
if:
# Get the Agent and the Navigatable interface
Navigatable := fc.GetNavigatable
Instigator := dmg_result.Instigator?
# Get the agent that instigated the damage

            then:
                Print("Start navigating to the InstigatingAgent")
                if (InstigatingAgent := agent[Instigator]):
                    Print("navigating...")
                    NavigationTarget := MakeNavigationTarget(InstigatingAgent)
                    Navigatable.NavigateTo(NavigationTarget)

Expected Result

“navigating” should print, and the npc should move to the player agent location

Observed Result

navigating print statement never prints. Manually casting the game instigator, via Instigator.GetInstigatorAgent. DOES MAKE THIS WORK AS EXPECTED!

Platform(s)

UEFN VERSE

Hey!

I’ve noticed that the only cast that I seem to get to work from damage_result is casting it as fort_character instead of agent if you’re looking to reach a player. :smiling_face:

Though I’ve noticed that the last couple of days that the Instigator and the Target in damage_result both actually returns the Target the moment that the player is knocked down now? (not sure if this is a result from the last update) So it feels like damage_result is a bit broken.

3 Likes