# getMinMaxDistance retrieves incorrect values

**URL:** <https://qa.fmod.com/t/getminmaxdistance-retrieves-incorrect-values/17750>\
**Category:** Unreal Engine\
**Tags:** ue4, cpp\
**Created:** [October 6, 2021, 8:09am UTC](https://qa.fmod.com/t/getminmaxdistance-retrieves-incorrect-values/17750 "2021-10-06T08:09:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvdvdv](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@dvdvdv](https://qa.fmod.com/u/dvdvdv)\
**Post date:** [October 6, 2021, 8:09am UTC](https://qa.fmod.com/t/getminmaxdistance-retrieves-incorrect-values/17750/1 "2021-10-06T08:09:57Z")

</div>

After upgrade to 2.02 EventDescription::getMaximumDistancs was replaced with EventDescription::getMinMaxDistance. However getMinMaxDistance sets my variables always to 0. This was working with getMaximumDistancs. I also tried EventInstance::getMinMaxDistance with no success again, it sets variables to -1. I’m using UE4.27

---

<div class="post-metadata">

**Author:** ![tristanjl](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/tristanjl/32/261_2.png) [@tristanjl](https://qa.fmod.com/u/tristanjl)\
**Post date:** [October 6, 2021, 10:39pm UTC](https://qa.fmod.com/t/getminmaxdistance-retrieves-incorrect-values/17750/2 "2021-10-06T22:39:10Z")

</div>

Hi dvdvdv,

Have you also upgraded your banks to 2.02? We changed min/max distance to be event properties, so that the spatializers obtain their min/max distance from the event rather than the other way around (with the option to override the event values in special cases).

We do have a fix coming shortly to get EventDescription::getMinMaxDistance to have the old behaviour for banks built prior to 2.02 as well.

---

<div class="post-metadata">

**Author:** ![dvdvdv](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@dvdvdv](https://qa.fmod.com/u/dvdvdv)\
**Post date:** [October 22, 2021, 7:17am UTC](https://qa.fmod.com/t/getminmaxdistance-retrieves-incorrect-values/17750/3 "2021-10-22T07:17:39Z")

</div>

I asked our sound artist about this and he reported banks were already upgraded at the time I posted to this forum. Since then he exported whole project few times.Today I tested project again and I was getting correct values. I’m not sure what caused or fixed the issue.

---

<div class="post-metadata">

**Author:** ![tristanjl](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/tristanjl/32/261_2.png) [@tristanjl](https://qa.fmod.com/u/tristanjl)\
**Post date:** [October 24, 2021, 10:10pm UTC](https://qa.fmod.com/t/getminmaxdistance-retrieves-incorrect-values/17750/4 "2021-10-24T22:10:39Z")

</div>

Maybe something got missed in the upgrade previously? At any rate, glad to hear it is now working.
