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 ?
Looking for this answer as well.
I’ll try to get someone to help.
Hey all, we’re digging in here. Ticket: FORT-784634
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.
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
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
You need to bind the trigger device
to your target device
through 1.0 DEB, there’s no Verse API exposed for that method, so there’s no other way
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.