How to get the agent from "source" for device_ai_interaction_result

This is my function that runs when a guard is eliminated, depending on what is happening in the game this may set off the end of the game. I need to pass an agent to the end game device but I have no idea how to get the agent object from the “source” of the result that comes back. How do I do that?

OnGuardEliminated(Res:device_ai_interaction_result):void=

if(Agent := Res.Source?): DoSomething(Agent)

2 Likes

thx❤️