# Get current distance from Spatializer

**URL:** <https://qa.fmod.com/t/get-current-distance-from-spatializer/16022>\
**Category:** FMOD Studio\
**Tags:** unity\
**Created:** [July 28, 2020, 5:49pm UTC](https://qa.fmod.com/t/get-current-distance-from-spatializer/16022 "2020-07-28T17:49:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Earan](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/earan/32/1375_2.png) [@Earan](https://qa.fmod.com/u/Earan)\
**Post date:** [July 28, 2020, 5:49pm UTC](https://qa.fmod.com/t/get-current-distance-from-spatializer/16022/1 "2020-07-28T17:49:11Z")

</div>

Hi everyone,

I wondered if it is possible to get the current distance from the spatializer effect, and use it to automate other effects/things.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [July 29, 2020, 1:50am UTC](https://qa.fmod.com/t/get-current-distance-from-spatializer/16022/2 "2020-07-29T01:50:54Z")

</div>

The Distance built in parameter automatically gets the information on how far the event emitter is from the listener. Otherwise you would need to use a combination of `EventInstance::get3DAttributes()` and `System::getListenerAttributes()` to do the calculation in your game’s code.

[https://www.fmod.com/resources/documentation-api?version=2.1&page=studio-api-eventinstance.html#studio\_eventinstance\_get3dattributes](https://www.fmod.com/resources/documentation-api?version=2.1&page=studio-api-eventinstance.html#studio_eventinstance_get3dattributes)

[https://www.fmod.com/resources/documentation-api?version=2.1&page=studio-api-system.html#studio\_system\_getlistenerattributes](https://www.fmod.com/resources/documentation-api?version=2.1&page=studio-api-system.html#studio_system_getlistenerattributes)
