# Getting an agent when the HitEvent from a shooting\_range\_target\_device is triggered

**URL:** <https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [June 19, 2024, 3:07pm UTC](https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135 "2024-06-19T15:07:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![electro.walker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@electro.walker](https://forums.unrealengine.com/u/electro.walker)\
**Post date:** [June 19, 2024, 3:07pm UTC](https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135/1 "2024-06-19T15:07:40Z")

</div>

Does anybody know how to get the agent who triggered the HitEvent from a shooting\_range\_target\_device ? Or at least, how to know which of the player hit or shot on a target ?

---

<div class="post-metadata">

**Author:** ![ElatedSheep983](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ElatedSheep983](https://forums.unrealengine.com/u/ElatedSheep983)\
**Post date:** [August 25, 2024, 9:37pm UTC](https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135/2 "2024-08-25T21:37:56Z")

</div>

Looking for this answer as well.

---

<div class="post-metadata">

**Author:** ![Flak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flak/32/769441_2.png) [@Flak](https://forums.unrealengine.com/u/Flak)\
**Post date:** [August 28, 2024, 12:33pm UTC](https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135/3 "2024-08-28T12:33:38Z")

</div>

I’ll try to get someone to help.

---

<div class="post-metadata">

**Author:** ![Flak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flak/32/769441_2.png) [@Flak](https://forums.unrealengine.com/u/Flak)\
**Post date:** [August 28, 2024, 10:17pm UTC](https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135/4 "2024-08-28T22:17:30Z")

</div>

Hey all, we’re digging in here. Ticket: FORT-784634

---

<div class="post-metadata">

**Author:** ![Vath](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vath/32/752388_2.png) [@Vath](https://forums.unrealengine.com/u/Vath)\
**Post date:** [August 29, 2024, 2:26pm UTC](https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135/5 "2024-08-29T14:26:57Z")

</div>

In the meantime you can workaround this issue by utilizing the trigger\_device to obtain a reference to the Agent. Here’s an example to obtain a reference to the Agent who triggered the device.

```auto
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

hello_world_device := class(creative_device):
    @editable
    SRT : shooting_range_target_device = shooting_range_target_device {}

    @editable
    TRG : trigger_device = trigger_device {}

    OnBegin<override>()<suspends>:void=

        TRG.TriggeredEvent.Subscribe(OnTriggered)
        SRT.HitEvent.Subscribe(OnHit)

    OnHit(Info : tuple()):void=
        TRG.Trigger()
    
    OnTriggered(MaybeAgent : ?agent):void=
        if(Agent := agent[MaybeAgent?]):
            # do stuff with Agent

```

---

<div class="post-metadata">

**Author:** ![congrets](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@congrets](https://forums.unrealengine.com/u/congrets)\
**Post date:** [October 18, 2024, 7:12pm UTC](https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135/6 "2024-10-18T19:12:38Z")

</div>

Is there any update on getting the agent directly through the shooting\_range\_target\_device without using a trigger device? I tried this and it did not work; the “if (Agent := agent[MaybeAgent?])” check fails

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [October 19, 2024, 8:30am UTC](https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135/7 "2024-10-19T08:30:10Z")

</div>

You need to bind the `trigger device` to your `target device` through 1.0 [DEB](https://dev.epicgames.com/documentation/en-us/uefn/direct-event-binding-in-unreal-editor-for-fortnite), there’s no Verse API exposed for that method, so there’s no other way

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [November 18, 2024, 8:30am UTC](https://forums.unrealengine.com/t/getting-an-agent-when-the-hitevent-from-a-shooting-range-target-device-is-triggered/1909135/8 "2024-11-18T08:30:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
