# Play sound wen a player get damaged

**URL:** <https://forums.unrealengine.com/t/play-sound-wen-a-player-get-damaged/2345288>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [February 19, 2025, 5:43pm UTC](https://forums.unrealengine.com/t/play-sound-wen-a-player-get-damaged/2345288 "2025-02-19T17:43:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattyTJ9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MattyTJ9](https://forums.unrealengine.com/u/MattyTJ9)\
**Post date:** [February 19, 2025, 5:43pm UTC](https://forums.unrealengine.com/t/play-sound-wen-a-player-get-damaged/2345288/1 "2025-02-19T17:43:18Z")

</div>

I’m new to the Verse field, I’m trying to create a way that allows to play a sound when the player takes damage (generic damage)  
Could someone help me, I can’t get the audio play

 ![Screenshot 2025-02-19 183505](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/c/fec718915d686373ce6ede88a885cdef7710f839.png)

---

<div class="post-metadata">

**Author:** ![MipM0rp](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mipm0rp/32/1078545_2.png) [@MipM0rp](https://forums.unrealengine.com/u/MipM0rp)\
**Post date:** [February 21, 2025, 12:03am UTC](https://forums.unrealengine.com/t/play-sound-wen-a-player-get-damaged/2345288/2 "2025-02-21T00:03:33Z")

</div>

Hi, I think you forgot the parentheses when you called your “PlayDamagedAaudio” function and passed the agent as parameters on line 43 and 48.

Try this, it should work :

```auto
PlayDamagedAaudio(Agent)

```

---

<div class="post-metadata">

**Author:** ![MattyTJ9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MattyTJ9](https://forums.unrealengine.com/u/MattyTJ9)\
**Post date:** [February 24, 2025, 9:37pm UTC](https://forums.unrealengine.com/t/play-sound-wen-a-player-get-damaged/2345288/3 "2025-02-24T21:37:04Z")

</div>

> [@MipM0rp](#):
>
> `(Agent)`

thanks but it still doesn’t work

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/7/9/079dd2d9a2635bcfca83395adcf2925bc7357fbb.png)

---

<div class="post-metadata">

**Author:** ![MipM0rp](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mipm0rp/32/1078545_2.png) [@MipM0rp](https://forums.unrealengine.com/u/MipM0rp)\
**Post date:** [February 24, 2025, 10:40pm UTC](https://forums.unrealengine.com/t/play-sound-wen-a-player-get-damaged/2345288/4 "2025-02-24T22:40:21Z")

</div>

Sorry, I misread your code and understood your request. I’m not sure who you want the audio to be heard by, from your code I assume you want the target to hear it.

To do this, you must retrieve the agent from the target of the “damage\_result”:

```auto
if (FC := fort_character[DR.Target], TargetAgent := FC.GetAgent[]):
   PlayDamagedAaudio(TargetAgent)

```

You also need to set the audio player setting: “Can be heard by =\> Instigator only”

And if you want both players to hear the sound, you can simply play the audio in your “OnPlayerDamaged” function without passing an agent :

```auto
AudioDevices1.Play()

```

and you have to set the audio player to “Can be heard by =\> everyone”

Hoping to help you

---

<div class="post-metadata">

**Author:** ![swaggod](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/swaggod/32/1051181_2.png) [@swaggod](https://forums.unrealengine.com/u/swaggod)\
**Post date:** [February 25, 2025, 6:06pm UTC](https://forums.unrealengine.com/t/play-sound-wen-a-player-get-damaged/2345288/5 "2025-02-25T18:06:58Z")

</div>

You also are using Agent where you have not initialized it, Verse only knows what Agent is in the context of PlayDamagedAudio. I would watch some starter Verse tutorials as variable scope is a very important concept in all of coding, here is a great series:  
[https://www.youtube.com/watch?v=uVjcBRaeTHU&ab\_channel=GraemeBull](https://www.youtube.com/watch?v=uVjcBRaeTHU&ab_channel=GraemeBull)

---

<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:** [March 27, 2025, 6:07pm UTC](https://forums.unrealengine.com/t/play-sound-wen-a-player-get-damaged/2345288/6 "2025-03-27T18:07:35Z")

</div>

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