# FMOD Spatializer Plugin - eventDescription.getMinMaxDistance returns wrong values in Unity on override in Studio

**URL:** <https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861>\
**Category:** FMOD Studio\
**Tags:** unity, csharp\
**Created:** [June 9, 2022, 10:44am UTC](https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861 "2022-06-09T10:44:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![wobblersound](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@wobblersound](https://qa.fmod.com/u/wobblersound)\
**Post date:** [June 9, 2022, 10:44am UTC](https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861/1 "2022-06-09T10:44:08Z")

</div>

used FMOD Studio & Unity Integration Version: 2.02.07

I do realize this issue might be somewhat connect to this:  
[How to get spatializer min max distance override in code](https://qa.fmod.com/t/how-to-get-spatializer-min-max-distance-override-in-code-fmod-2-02-03/17913)

The Fmod Unity Integration will return wrong values for eventDescription.getMinMaxDistance if override is used on Spatializer plugin in Studio under certain cirumstances

Steps to reproduce:

- Create event
- Place spatializer on event master
- set override on spatializer to true, change max distance to some other value (e.g. 200)

if then reading out minMaxDistance from eventdescription or eventinstance in unity, notice that old value is still shown.  
(Attenuation will work correctly in terms of hearing-range, but the shown value is wrong)

If you go back to fmod, and turn override off then on again on spatializer directly when event is selected, and build bank anew, then max attenuation will be shown correctly.  
HOWEVER, this workaround does not work if i use presets and i go to preset and turn off/on override. I need to specifially go to the event and turn it off/on there.

Having the wrong value sent means i cannot possibly start / stop sounds based on distance by code. (only by using the workaround mentioned in other thread which means instance needs to be playing, etc.)

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [June 16, 2022, 2:34am UTC](https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861/2 "2022-06-16T02:34:34Z")

</div>

Thank you for reporting this issue, I have reproduced it as described. I have passed this on to the development team to fix in a future release. In the meantime, would it be possible for you to use the [workaround](https://qa.fmod.com/t/how-to-get-spatializer-min-max-distance-override-in-code-fmod-2-02-03/17913/8) in the linked forum post to batch override the min and max distance of events at build time?

---

<div class="post-metadata">

**Author:** ![wobblersound](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@wobblersound](https://qa.fmod.com/u/wobblersound)\
**Post date:** [June 17, 2022, 7:52am UTC](https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861/3 "2022-06-17T07:52:57Z")

</div>

yeah, kind of - we use the DSP getter method as we use dynamic camera distances, thus we have automated the max attenuation.  
Looking forward to a fix!

---

<div class="post-metadata">

**Author:** ![GiacomoF](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@GiacomoF](https://qa.fmod.com/u/GiacomoF)\
**Post date:** [December 8, 2022, 11:04pm UTC](https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861/4 "2022-12-08T23:04:56Z")

</div>

+1 for wanting a proper API solution to this problem

---

<div class="post-metadata">

**Author:** ![wobblersound](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@wobblersound](https://qa.fmod.com/u/wobblersound)\
**Post date:** [April 6, 2023, 7:48pm UTC](https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861/5 "2023-04-06T19:48:13Z")

</div>

hello Jeff, has this issue been adressed in the meantime?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [April 11, 2023, 12:09am UTC](https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861/6 "2023-04-11T00:09:37Z")

</div>

After discussing with the Dev team they have told me that `EventDescription::getMinMaxDistance` not returning the spatializer-overriden value is intended behavior.

The intention of this change in behavior was to make min/max distance a property of the event, and for spatializers to read the event’s min/max distance. Spatializers can choose to ignore the event’s min/max distance, but this will not override the event’s min/max distance, which is what is being retrieved with `EventDescription::getMinMaxDistance`. There is a change planned for an upcoming release to better reflect this in FMOD Studio by no longer hiding the _Min & Max Distance_ slider in the Event Macros.

Instead of modifying `EventDescription::getMinMaxDistance`, I have suggested to the Dev team to reintroduce the 2.01 API methods [`EventDescription::getMaximumDistance`](https://fmod.com/docs/2.01/api/studio-api-eventdescription.html#studio_eventdescription_getmaximumdistance) and [`EventDescription::getMinimumDistance`](https://fmod.com/docs/2.01/api/studio-api-eventdescription.html#studio_eventdescription_getminimumdistance), which search for the highest and lowest spatializer values respectively, which might be a better solution as it will preserve the meaning behind `EventDescription::getMinMaxDistance`, but still allow you to get the overriden min/max values from an overriding spatializer when an event isn’t playing.

---

<div class="post-metadata">

**Author:** ![alberto.barbati](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@alberto.barbati](https://qa.fmod.com/u/alberto.barbati)\
**Post date:** [October 13, 2023, 2:31pm UTC](https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861/7 "2023-10-13T14:31:35Z")

</div>

Any ETA for the `EventDescription::getMaximumDistance` and `EventDescription::getMinimumDistance` functions? Your message was written in April and now it’s October, but the functions still haven’t been reintroduced.

---

<div class="post-metadata">

**Author:** ![Andrew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/andrew/32/261_2.png) [@Andrew](https://qa.fmod.com/u/Andrew)\
**Post date:** [October 16, 2023, 11:08pm UTC](https://qa.fmod.com/t/fmod-spatializer-plugin-eventdescription-getminmaxdistance-returns-wrong-values-in-unity-on-override-in-studio/18861/8 "2023-10-16T23:08:17Z")

</div>

No ETA yet but thanks for registering your interest in this issue.
