# GetProperty Maximum Distance returns 0.0

**URL:** <https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787>\
**Category:** Unreal Engine\
**Tags:** ue4\
**Created:** [October 13, 2021, 5:09am UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787 "2021-10-13T05:09:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephenrfrank](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@stephenrfrank](https://qa.fmod.com/u/stephenrfrank)\
**Post date:** [October 13, 2021, 5:09am UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787/1 "2021-10-13T05:09:18Z")

</div>

I am trying to get the maximum distance of an event in UE4 so that I can turn a custom occlusion engine on and off if the object is outside the audible range. However, using GetProperty in a Blueprint only returns 0.0 for Maximum distance. Is there something I am missing here?

Thank you!

---

<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:** [October 18, 2021, 4:40am UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787/2 "2021-10-18T04:40:15Z")

</div>

The `getProperty` function is used to get a struct of the properties of the event which you can then override and then use `setProperty` to override the properties the event currently has.

You should be able to get the min/max distance settings by using `EventDescription::getMinMaxDistance()`.

[https://www.fmod.com/resources/documentation-api?version=2.02&page=studio-api-eventdescription.html#studio\_eventdescription\_getminmaxdistance](https://www.fmod.com/resources/documentation-api?version=2.02&page=studio-api-eventdescription.html#studio_eventdescription_getminmaxdistance)

---

<div class="post-metadata">

**Author:** ![stephenrfrank](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@stephenrfrank](https://qa.fmod.com/u/stephenrfrank)\
**Post date:** [October 18, 2021, 5:48am UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787/3 "2021-10-18T05:48:40Z")

</div>

Thank you Richard.

After some serious digging I did come to realize that getting min/max distance would have to be done through the Studio API and not blueprints.

However, I am having a really hard time getting the API to work. I have the plug-in set up but everytime I try to include fmod\_studio.hpp, if can’t be found. I feel like I must either be including that in the wrong place or I am just totally missing something. I have also tried putting FMODStudio in the private and public locations in the build scripts but that doesn’t seem to work either. I am not new to code but i am new to game code structure. Do you have any insights on how to get access to the API?

Thanks for your help!

S

---

<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:** [October 21, 2021, 3:00pm UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787/4 "2021-10-21T15:00:59Z")

</div>

Have you tried setting up the UE4 project as described in the documentation? There’s a section on adding elements to the Build.cs file.

[https://www.fmod.com/resources/documentation-ue4?version=2.02&page=user-guide.html#programming-support](https://www.fmod.com/resources/documentation-ue4?version=2.02&page=user-guide.html#programming-support)

---

<div class="post-metadata">

**Author:** ![stephenrfrank](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@stephenrfrank](https://qa.fmod.com/u/stephenrfrank)\
**Post date:** [October 27, 2021, 11:16pm UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787/5 "2021-10-27T23:16:11Z")

</div>

Hey Richard

I finally got it working. I needed to rebuild the visual studio project from inside Unreal in order for FMOD to place all the dependencies in the right place. The manual was correct in that I needed to put FMODStudio in the build.cs file but the fact that I needed to do a rebuild after that was something I was not aware of.

Thanks!

S

---

<div class="post-metadata">

**Author:** ![zsombor.bencsik](https://avatars.discourse-cdn.com/v4/letter/z/ee7513/32.png) [@zsombor.bencsik](https://qa.fmod.com/u/zsombor.bencsik)\
**Post date:** [January 8, 2024, 3:31pm UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787/6 "2024-01-08T15:31:49Z")

</div>

I’m having the same issue when using Get Property (Max Distance) in a Blueprint. Any idea why?

---

<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:** [January 9, 2024, 2:51am UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787/7 "2024-01-09T02:51:57Z")

</div>

Hi,

What version of the FMOD integration are you using?

Can you please tick [Enable API Error Logging](https://fmod.com/docs/2.02/unreal/settings.html#enable-api-error-logging). Can you please set your [Logging Level](https://fmod.com/docs/2.02/unreal/settings.html#logging-level) to “Level Warning”, and check for any FMOD errors in the console output?

---

<div class="post-metadata">

**Author:** ![zsombor.bencsik](https://avatars.discourse-cdn.com/v4/letter/z/ee7513/32.png) [@zsombor.bencsik](https://qa.fmod.com/u/zsombor.bencsik)\
**Post date:** [January 10, 2024, 4:00pm UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787/8 "2024-01-10T16:00:22Z")

</div>

No warning with logging enabled, however now I’m getting -1.0 floats for max distance property. Can you reproduce this issue?

UE 4.27  
FMOD Studio 2.02.14

---

<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:** [January 16, 2024, 4:57am UTC](https://qa.fmod.com/t/getproperty-maximum-distance-returns-0-0/17787/9 "2024-01-16T04:57:49Z")

</div>

Hi,

So the `GetProperty` function will not get the value set through FMOD Studio, however, it will use a value set by the [SetProperty](https://fmod.com/docs/2.02/unreal/blueprint-reference-component.html#set-property) node.

To retrieve the default value you will have to use code unfortunately.
