# Snap Fmod emitter to player, constrained by 3D shape (not Spline)

**URL:** <https://qa.fmod.com/t/snap-fmod-emitter-to-player-constrained-by-3d-shape-not-spline/22070>\
**Category:** Unreal Engine\
**Created:** [September 7, 2024, 10:07pm UTC](https://qa.fmod.com/t/snap-fmod-emitter-to-player-constrained-by-3d-shape-not-spline/22070 "2024-09-07T22:07:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![afrech](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/afrech/32/1573_2.png) [@afrech](https://qa.fmod.com/u/afrech)\
**Post date:** [September 7, 2024, 10:07pm UTC](https://qa.fmod.com/t/snap-fmod-emitter-to-player-constrained-by-3d-shape-not-spline/22070/1 "2024-09-07T22:07:06Z")

</div>

Hi there, I’m trying to create a BP that will have a spatialized fmod sound within it, that is always trying to get to the players location, but is constrained by a 3D volume.

Similar to moving the emitter along a spline, but I can’t seem to find a replacement for the “Find Location Closest to World Location” that spline components have.

Any help appreciated!  
here’s a shot of my spline version and the part i’m trying to replace

 ![3dvol](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/2/2eb1883cead31994ace3c22aa39a17d916f9062d.jpeg)

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [September 10, 2024, 1:06am UTC](https://qa.fmod.com/t/snap-fmod-emitter-to-player-constrained-by-3d-shape-not-spline/22070/2 "2024-09-10T01:06:53Z")

</div>

Just so I understand exactly what you’re going for, can I get you to elaborate on the full behavior of the blueprint/event in relation to the player? For example, what is intended audio behaviour when the player is outside vs inside the volume?

---

<div class="post-metadata">

**Author:** ![afrech](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/afrech/32/1573_2.png) [@afrech](https://qa.fmod.com/u/afrech)\
**Post date:** [September 10, 2024, 2:35am UTC](https://qa.fmod.com/t/snap-fmod-emitter-to-player-constrained-by-3d-shape-not-spline/22070/3 "2024-09-10T02:35:28Z")

</div>

Hi there, thanks for the reply.

The intended behaviour is for the emitter to snap to the players location within the volume, and snap to the closest point to the player, when the player is outside the volume. So combining that with the pan override the sound can be 2D within and Spatialized outside. For example I could drop a cube on an area of forest, so the player can hear the forest as they approach, and once inside are surrounded by it.

I’ve managed to solve this, so anyone else that may come across looking for the same thing: There is an equivalent node called “Get Closest Point on Collision” which seems to do exactly what I want it to do, and can be used with a collision box, sphere, or capsule  
 ![Screenshot 2024-09-09 223422](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/9/9c737e3989e46563c940ab0bc6904c4bc84117a6.jpeg)

The “Out point on body” is then used to set the location of the fmod component every Nths of a second

Though if there is an even simpler ways of achieving this, I’m all ears.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [September 13, 2024, 2:34am UTC](https://qa.fmod.com/t/snap-fmod-emitter-to-player-constrained-by-3d-shape-not-spline/22070/4 "2024-09-13T02:34:08Z")

</div>

Happy to hear you found a solution!

What you’ve implemented is likely how I’d consider solving this specific problem. Another hypothetical way to do it would be to automate either the centered 2D pan mix or (in 2.03) the [wet/dry](https://www.fmod.com/docs/2.03/studio/authoring-events.html#input-gain-and-wetdry) of the event’s spatializer based on a [built-in distance parameter](https://www.fmod.com/docs/2.03/studio/parameters-reference.html#distance), in order to effectively disable spatialization when within a certain distance of the listener.
