Hello guys…
I want to show a widget blueprint to whatever player enters a Damage Volume Device. I noticed that there’s a function called “AgentEntersEvent” but i don’t know how to use it. How can I detect and get the player that enters and exits the Damage Volume Device so that I can show them the Widget?
You need to subscribe the event to a function. You can do this by targeting the damage volume either individually or via an array or even Verse_Tags. There is a tags example
in the UEFN Documentation you could use for that. Here is some example Verse code on how you could accomplish this using the individual damage volume setting option.
#Allows setting 1 damage volume from the details pane
#You could make this an array like this:
#SpecialDamageVolumesArray : []damage_volume_device := array{}
#Then loop through each:
for(DamageVolume : SpecialDamageVolumesArray):
DamageVolume.Subscribe(DamageVolumeEvent)
#Another solution would be to use Tags and find each device with the Verse_Tag and loop through those
@editable
SpecialDamageVolume : damage_volume_device = damage_volume_device{}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
#Your Code
SpecialDamageVolume.AgentEntersEvent.Subscribe(DamageVolumeEvent)
DamageVolumeEvent(InPlayer:agent) : void =
#Your Code