UE4 not working correctly with Play Event Attached

Hi all. Before discussing the issue, we’re using UE 4.26.1 and FMOD 2.01.09

When we use “Play Event Attached” in Unreal, it doesn’t get the attenuation distances from FMOD at all. We tried printing the attenuation values that were supposedly being called from FMOD but they were always 1 and 10 respectively independently of what values were set in FMOD.

We’re currently setting those values from UE4 but they should be working from FMOD normally.

Anyone knows a fix for this? Thanks!

Respectfuly, Andrés.

Yeah, that’s true, the values min and max distance are reported incorrectly and always return 1 and 10. But anyway, the attenuation does seem to work correctly, despite these wrong values reported.
By the way, in your code, I don’t understand why you set attenuation details from the attenuation details of the same target you’re trying to set… So in this case it won’t work: you’re overriding the attenuation details by 1 and 10.

What’s your goal here: to have the spatializer working or to retrieve correct attenuation details values?

The FMOD Audio Component returned from Play Event Attached has Attenuation Details Override Attenuation enabled. It doesn’t look like there is a way to disable this behavior, but even if you could it wouldn’t return a useful value due to a known limitation of the API.
Unfortunately there is currently no way to retrieve the Spatializer min and max values from FMOD Studio via Blueprints, but in C++ you can access theses values from an event’s EventReference using EventReference::getMinMaxDistance. There is currently a task in our backlog that should make the Spatializer min and max values available in Blueprints in the future.

Hello Alcibiade. Thanks for your response. My goal is to have a sound attached to a moving object and that it has the correct attenuation values. For that, I have the sound in FMOD be modified by the distance parameter. I’m unsure of how to set the parameter if it is not in this manner. Does “Play Event Attached” automatically set the distance?

Of course, you have nothing more to do. Just remove your 2 last nodes get/set attenuation details and it will work as you want.

Hum, this let me think you didn’t understand correctly the spatializer, the min-max distance, and the distance built-in parameter. The min-max distance only concerns the spatializer, not the built-in distance parameter. The spatializer, if included in the effect chain, automatically applies an attenuation based on distance (and on min-max settings), you don’t have to automate anything in top of that. The built-in distance parameter is used to create a custom behavior based on distance (like for applying a low-pass filter, or playing a different sound depending on the distance) ; anyway, the min-max distance settings have no effect on the distance built-in parameter.

And anyway, the distance built-in parameter, as well as the location used by the spatializer, is automatically passed to FMOD engine by the game engine, from the relative location of the event with the listener. You don’t have to set any location/distance parameter, if the event is attached to an actor.

Thank you for you quick response. Yeah, I’m a bit new to FMOD and UE4, and I am actually not the programmer but the sound designer. I’m still learning this, and thank you for taking the time to explain it to me. I think I understand it better and we’ve changed the blueprint. However, we can only test this tomorrow when a build is up. I’ll let you know if it works.

I have another question then. If we have to set an FMOD parameter other than distance, for what I understand, we need to set the “Play Event Attached” to not work on Auto Play, send a node to set the parameter with the target being the Return Value from the Play Event Attached, and then a Play event. Would that be correct?

Yes, exactly.

1 Like

Thank you very much. I will let you know what we find

1 Like

It works fine now! Thank you!

1 Like