# Min Max distance set from code not working correctly

**URL:** <https://qa.fmod.com/t/min-max-distance-set-from-code-not-working-correctly/21398>\
**Category:** FMOD Engine\
**Tags:** cpp\
**Created:** [March 22, 2024, 3:41pm UTC](https://qa.fmod.com/t/min-max-distance-set-from-code-not-working-correctly/21398 "2024-03-22T15:41:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bendeguz](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Bendeguz](https://qa.fmod.com/u/Bendeguz)\
**Post date:** [March 22, 2024, 3:41pm UTC](https://qa.fmod.com/t/min-max-distance-set-from-code-not-working-correctly/21398/1 "2024-03-22T15:41:07Z")

</div>

FMOD\_STUDIO\_EVENT\_PROPERTY\_MAXIMUM\_DISTANCE & FMOD\_STUDIO\_EVENT\_PROPERTY\_MINIMUM\_DISTANCE

These properties do not work when set from code if the override option is checked on the Studio side. If it’s off, it works as expected. Maybe this isn’t unexpected behavior but it would be an important feature to modify this value regardless of studio values.  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/3/390036f26805e8bb61f4b1a9d2255679710e04fd.png)

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [March 25, 2024, 3:39am UTC](https://qa.fmod.com/t/min-max-distance-set-from-code-not-working-correctly/21398/2 "2024-03-25T03:39:03Z")

</div>

Hi,

What version of the FMOD integration are you using?

Could I get some reproduction steps or the code used to set the values?

---

<div class="post-metadata">

**Author:** ![Bendeguz](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Bendeguz](https://qa.fmod.com/u/Bendeguz)\
**Post date:** [March 25, 2024, 8:19am UTC](https://qa.fmod.com/t/min-max-distance-set-from-code-not-working-correctly/21398/3 "2024-03-25T08:19:29Z")

</div>

Hi!  
Version: 2.02.05  
Edit:  
Noticed that the Studio version is newer 2.02.21

![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/b/bed5ad0ae502d1657905cbe7a3423b3c5806ad6a.png)  
Setting these properties before or after starting the sound did not solve this.

---

<div class="post-metadata">

**Author:** ![tristanlewis](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@tristanlewis](https://qa.fmod.com/u/tristanlewis)\
**Post date:** [March 25, 2024, 6:12pm UTC](https://qa.fmod.com/t/min-max-distance-set-from-code-not-working-correctly/21398/4 "2024-03-25T18:12:49Z")

</div>

This sounds like the intended behaviour, as the event min/max distance is at the event level, while a spacializer distance override is at the dsp level.

If you want to set the value for an overridden min/max distance, you should automate the min/max distance values with a parameter and set the parameter value appropriately instead.

---

<div class="post-metadata">

**Author:** ![Bendeguz](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Bendeguz](https://qa.fmod.com/u/Bendeguz)\
**Post date:** [March 26, 2024, 8:01am UTC](https://qa.fmod.com/t/min-max-distance-set-from-code-not-working-correctly/21398/5 "2024-03-26T08:01:08Z")

</div>

Was wondering if this was intended behavior. Thanks for the answer!
