|Topic was automatically imported from the old Question2Answer platform.
TL;DR - I want to enable a reverb effect when my player is underground but not effect any currently playing sounds.
I have a simple platformer and sometimes the player goes underground. So when the player’s Y position is at the right place I do the following
AudioServer.set_bus_effect_enabled(bus_effects, 0, true)
This works pretty good. The issue is if my player makes a sound while on one side of the position check, then goes to the other side, the effect is changed mid way through. So, for example, if my player jumps while inside the cave, but lands outside, the echo of the jump gets cut off and it sounds weird. I did Find this question but in testing this method out I found that the reported volume levels when an effect wasn’t playing were not always -200. In fact, they weren’t always even the same value. So I don’t think that’s reliable way of checking if a sound is playing. Any thoughts would be greatly appreciated.
if my player jumps while inside the cave, but lands outside, the echo of the jump gets cut off and it sounds weird.
Can you make the sound hold until the player character is outside of the cave? Until the player is outside the cave, have the echo sound effect in place.
Ertain | 2020-07-18 03:17
That’s what I would like to do. Now, once the player leaves the cave area, the effect is turned off, but that change is applied in real time, so any sounds still playing now have the effect removed, and it works in reverse too. making a sound outside the cave area starts without an echo, but once you cross into the cave, the echo is applied. After more thinking about it all day, I’m wondering if i can maybe poll all the AudioStreamPlayer2D nodes to see if they are playing, and if so, don’t apply the effect until they are all stopped.
Nautic | 2020-07-18 06:37