# How to detect and play different sound when the ball hits the door vs floor vs desk?

**URL:** <https://forums.unrealengine.com/t/how-to-detect-and-play-different-sound-when-the-ball-hits-the-door-vs-floor-vs-desk/387673>\
**Category:** Audio\
**Tags:** hit-detection, collision-detection, unreal-engine, hit-event, question\
**Created:** [March 12, 2017, 6:15am UTC](https://forums.unrealengine.com/t/how-to-detect-and-play-different-sound-when-the-ball-hits-the-door-vs-floor-vs-desk/387673 "2017-03-12T06:15:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AtmaStudios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AtmaStudios](https://forums.unrealengine.com/u/AtmaStudios)\
**Post date:** [March 12, 2017, 6:15am UTC](https://forums.unrealengine.com/t/how-to-detect-and-play-different-sound-when-the-ball-hits-the-door-vs-floor-vs-desk/387673/1 "2017-03-12T06:15:13Z")

</div>

I have been getting really far with BluePrints and I figured this would be easy. Essentially, I have a ball that has physics and collisions enabled. The other objects have collisions enabled. I would like to have only the ball make a different sound when it hits the door, vs when it hits the floor, or the desk, not any other actor that triggers those collision boxes or hit events.

Can someone please share a simple blueprint layout or video that does this? One moving actor that hits 3 different static actors and makes a different sound when it hits each one.

Ideally I would like the Ball’s blueprint to detect which static mesh it hits and then triggers the appropriate sound accordingly, so then I can copy that blueprint script into other actors who may hit the wall, door, or desk and play different sounds in the future.

I have googled and googled, youtubed and youtubed, and hunted this forum. I feel lost. Thank you.

---

<div class="post-metadata">

**Author:** ![Erytriel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erytriel](https://forums.unrealengine.com/u/Erytriel)\
**Post date:** [March 12, 2017, 11:30am UTC](https://forums.unrealengine.com/t/how-to-detect-and-play-different-sound-when-the-ball-hits-the-door-vs-floor-vs-desk/387673/2 "2017-03-12T11:30:59Z")

</div>

heyho 🙂

try to work with that here:  
maybe u have to adapt it a little bit , but defining tags (i guess case sensitive!)to the actors(objects you roll on , walls doors,grounds) and checking at a component hit would be a simple solution

be careful this doesnot work with bsp brushes i guess^^

 ![129703-help1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/7/dc7132a9860ba51665e2ed465fd0257e12668a21.png)

i hope i could help a little bit

---

<div class="post-metadata">

**Author:** ![AtmaStudios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AtmaStudios](https://forums.unrealengine.com/u/AtmaStudios)\
**Post date:** [March 13, 2017, 5:12am UTC](https://forums.unrealengine.com/t/how-to-detect-and-play-different-sound-when-the-ball-hits-the-door-vs-floor-vs-desk/387673/3 "2017-03-13T05:12:59Z")

</div>

Erytriel,

First off thank you for taking the time to try and help me. I have copied this piece for piece into my project assigning each to it’s respective part. The only thing I could not find is “OnComponentHit” no matter what I typed I could not find that in my blueprints. My Ball actor is a BluePrint class if that changes anything?

Unfortunately it is not working for me. ☹

Here is a screen shot.

 ![129777-different+sound+when+actor+collides+with+different+object.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/d/26ddbebecb58020d2420b6a425a09eed41a0b265.jpeg)

Thank you again!

---

<div class="post-metadata">

**Author:** ![Erytriel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erytriel](https://forums.unrealengine.com/u/Erytriel)\
**Post date:** [March 13, 2017, 12:34pm UTC](https://forums.unrealengine.com/t/how-to-detect-and-play-different-sound-when-the-ball-hits-the-door-vs-floor-vs-desk/387673/4 "2017-03-13T12:34:27Z")

</div>

i created a collisionsphere , a little bit bigger than the character so when it hits something ,the whole thing should fire^^

you get access to this “on actor hit” if you click on the collisionsphere/box whatever you could created on the left side of your blueprint where the mesh and capsule component also is.

then click it, and under details scroll to the bottom where all avaivable action are and clik on it (hit, overlap and and and)

---

<div class="post-metadata">

**Author:** ![AtmaStudios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AtmaStudios](https://forums.unrealengine.com/u/AtmaStudios)\
**Post date:** [March 21, 2017, 9:44pm UTC](https://forums.unrealengine.com/t/how-to-detect-and-play-different-sound-when-the-ball-hits-the-door-vs-floor-vs-desk/387673/5 "2017-03-21T21:44:26Z")

</div>

A collisionsphere? Like on the ball actor as a component?
