# How to get the agent from "source" for device\_ai\_interaction\_result

**URL:** <https://forums.unrealengine.com/t/how-to-get-the-agent-from-source-for-device-ai-interaction-result/1213899>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [June 29, 2023, 12:28am UTC](https://forums.unrealengine.com/t/how-to-get-the-agent-from-source-for-device-ai-interaction-result/1213899 "2023-06-29T00:28:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GraemeBB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/graemebb/32/1106150_2.png) [@GraemeBB](https://forums.unrealengine.com/u/GraemeBB)\
**Post date:** [June 29, 2023, 12:28am UTC](https://forums.unrealengine.com/t/how-to-get-the-agent-from-source-for-device-ai-interaction-result/1213899/1 "2023-06-29T00:28:00Z")

</div>

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=

---

<div class="post-metadata">

**Author:** ![\_Nils](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_Nils](https://forums.unrealengine.com/u/_Nils)\
**Post date:** [July 23, 2023, 1:37pm UTC](https://forums.unrealengine.com/t/how-to-get-the-agent-from-source-for-device-ai-interaction-result/1213899/2 "2023-07-23T13:37:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![IKINGHA](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IKINGHA](https://forums.unrealengine.com/u/IKINGHA)\
**Post date:** [September 27, 2024, 5:47pm UTC](https://forums.unrealengine.com/t/how-to-get-the-agent-from-source-for-device-ai-interaction-result/1213899/3 "2024-09-27T17:47:58Z")

</div>

thx❤️
