![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Diet Estus |
I am trying to make a menu in my game from which users can change the volumes of all sounds in the game at once. Most games have a feature like this.
I am working in Godot 3.0.
Currently, I have a Sound singleton which consists of AudioStreamPlayer2Ds
, one per sound effect. Many of my nodes use this singleton to play their sound effects.
I also have some special nodes which have their own Sound nodes built in. These special sound nodes also consist of AudioStreamPlayer2Ds
.
My question is: How can I write a function to change all the volumes of my AudioStreamPlayer2Ds at once?
Should I simply iterate over game objects looking for the nodes and increase their volume_db
? Is there a better way?
I searched around for an answer but there’s a lot of noise from Godot 2.0, which treats audio differently from Godot 3.0.