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!
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
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
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
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
I’m having the same issue when using Get Property (Max Distance) in a Blueprint. Any idea why?
Hi,
What version of the FMOD integration are you using?
Can you please tick Enable API Error Logging. Can you please set your Logging Level to “Level Warning”, and check for any FMOD errors in the console output?
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
1 Like
Hi,
So the GetProperty
function will not get the value set through FMOD Studio, however, it will use a value set by the SetProperty node.
To retrieve the default value you will have to use code unfortunately.