When I retrieve the distance using getMinMaxDistance
and set it using set3DMinMaxDistance
, only the functionality of muting sound beyond the distance works. In FMOD Studio, adjusting the distance applies volume attenuation accordingly, but when modifying this value in Unity, only the muting effect works, and no changes in attenuation are observed.
I tried obtaining the channelGroup
and using setMode(FMOD.MODE._3D | FMOD.MODE._3D_LINEARROLLOFF);
, but this only works for non-event cases, so it was not meaningful.
Even modifying the properties using:
setProperty(FMOD.Studio.EVENT_PROPERTY.MINIMUM_DISTANCE)
setProperty(FMOD.Studio.EVENT_PROPERTY.MAXIMUM_DISTANCE)
did not affect the attenuation.
Summary:
Case 1:
When the distance is set to 1–20 in FMOD and the bank file is built:
- At a distance of 1, the sound is loud as expected.
- At a distance of 20, the sound is properly attenuated and quieter.
- After setting the distance to 1–100 using
setProperty
orset3DMinMaxDistance
, the sound still disappears at a distance of 30 (attenuation is not applied correctly). - When the distance is set to 1–10 using
setProperty
orset3DMinMaxDistance
, the sound is still loud at 9, but it suddenly mutes when moving to 11 (attenuation is not applied correctly).
Case 2:
When the distance is set to 1–100 in FMOD and the bank file is built:
- At a distance of 1, the sound is loud as expected.
- At a distance of 100, the sound is properly attenuated and quieter.
- After setting the distance to 1–20 using
setProperty
orset3DMinMaxDistance
, the sound is still loud at 19, but it suddenly mutes at 21 (attenuation is not applied correctly). - When the distance is set to 1–1000 using
setProperty
orset3DMinMaxDistance
, the sound should still be loud at 100. However, the attenuation is not applied correctly, and the sound is already inaudible.
It seems there is a bug in the functionality of setProperty
and set3DMinMaxDistance
. When will this issue be resolved?
I have searched through past discussions, but the only advice was to use these functions without properly addressing the problem. It appears the attenuation functionality is not correctly updated.
Please address this critical functionality omission bug and improve it.
Here is a part of the code where attenuation is not applied correctly:
if (eventDescription.isValid())
{
instance = GetInstance();
if (instance.isValid() && is3D)
{
FMOD.RESULT result = instance.getChannelGroup(out FMOD.ChannelGroup channelGroup);
if (result == FMOD.RESULT.OK)
{
//Debug.Log("Channel group successfully retrieved.");
//channelGroup.setMode(FMOD.MODE._3D | FMOD.MODE._3D_LINEARROLLOFF);
channelGroup.set3DMinMaxDistance(MinMaxDistance.x, MinMaxDistance.y);
}
{
RuntimeManager.AttachInstanceToGameObject(instance, target);
instance.set3DAttributes(RuntimeUtils.To3DAttributes(target));
}
instance.setProperty(FMOD.Studio.EVENT_PROPERTY.MINIMUM_DISTANCE, MinMaxDistance.x);
instance.setProperty(FMOD.Studio.EVENT_PROPERTY.MAXIMUM_DISTANCE, MinMaxDistance.y);
}
}
Currently, due to this bug, I have to manually adjust the distance settings for all audio events in FMOD, rebuild them, and then check them in Unity, which is very inconvenient.
If the attenuation functionality works correctly, I would be able to test it in Unity at runtime.
Please assist with this issue.