I’m working on a splitscreen multiplayer project and wanted to implement a reverb effect only when one of the players is inside the reverb zone. I’m using the Reverb3D API.
During gameplay, I’m instantiating 2 listeners (L0 and L1). My expected outcome should be as follows:
If a listener is inside the reverb area, events caught by it should have the reverb effect.
If a listener is outside the reverb area, events caught by it should NOT have the reverb effect.
But this is what’s currently happening:
L0 steps inside the zone with L1 outside and the reverb works for ALL events caught by L0 and L1
L1 steps inside the zone with L0 outside and there’s no reverb effect.
Both listeners are using their respective GameObject position and their respective player’s camera rotation as attributes.
All my audio events are setting their reverb properties when instanced like so:
eventInstance.setReverbLevel(reverbZoneIndex, 1);
Here’s the initialization code for the Reverb Zones:
[SerializeField, Min(0)] private float minDistance;
[SerializeField, Min(0)] private float maxDistance;
private Reverb3D _reverbRef;
private REVERB_PROPERTIES _reverbProperties;
private VECTOR _reverbPosition;
private void OnEnable()
{
if (!_reverbRef.hasHandle())
{
RuntimeManager.CoreSystem.createReverb3D(out _reverbRef);
}
// this just sets the properties to one of the FMOD presets
GetReverbProperties(out _reverbProperties);
_reverbPosition = transform.position.ToFMODVector();
_reverbRef.set3DAttributes(ref _reverbPosition, minDistance, maxDistance);
_reverbRef.setProperties(ref _reverbProperties);
_reverbRef.setActive(true);
}
private void OnDisable()
{
if (_reverbRef.hasHandle())
{
_reverbRef.setActive(false);
}
}
private void OnDestroy()
{
_reverbRef.release();
_reverbRef.setActive(false);
}
Both listeners’ properties are being updated during the Update Unity event.
My understanding is that, once a listeners position is within a reverb zone, the reverb applies to it. Is there any reason why the second listener isn’t getting the reverb even when its within the area?
This is a known issue with using multiple listeners with the Reverb3D system. Unfortunately I don’t have a simple workaround to offer that still makes use of the Reverb3D system, so if possible I’d recommend implementing your own reverb zone system using Studio tools like snapshots and parameters to control reverb sends and properties.
So that I can help you with the best way to go about this, can I get you to clarify what exactly you mean by “events caught by it” in your sentences:
Do you mean events instances that are within the reverb area, or that are heard by the listener, or both, or something else entirely?
Also, what versions of Unity and FMOD for Unity/FMOD Studio are you using?
Do you mean events instances that are within the reverb area, or that are heard by the listener, or both, or something else entirely?
The second one, events heard by a specific listener
Also, what versions of Unity and FMOD for Unity/FMOD Studio are you using?
I’m currently using Unity 6.0.25 and FMOD 2.03.06
I ended up solving it without using the Reverb3D API, I did the following:
Added an FX return bus for Player 1 and one for Player 2
Added a local parameter named “Player Index”, its used to automatize a Send towards the two buses mentioned above (eg, if value is 1, send only to Player1 FX; if value is 2 send only to Player2 FX).
“Player Index” parameter is set in-game depending on the closest listener.
Effects are controlled with snapshots via in-game triggers
And that pretty much did the trick. Only tedious thing is that it needs to be set in a per-event basis (i wanted a solution where i didn’t need to do that) but right now the project doesn’t have too many events to implement this solution.
There’s a couple of ways to make this less tedious, depending on what exactly you need:
Create an event with the automated sends you want, then right click and select “Add to presets”. You can then create events from the preset that will contain the sends by default
Right click on the send and convert it to a shared effect, which can then be shared across all event instances that require it. Note that all instances of the shared effect will share the same property values and automation, so this may not be as useful if you need per-event tweaking (though you can detach the send from the shared effect for individual tweaks)
Place your sends in a bus at the mixer level instead, and route the events that need to make use of those sends to the bus/buses