I have a main menu with an ‘Options’ button.
The player clicks that ‘Options’ button, a sound plays…other code…then a ‘WidgetSwitcher’ is constructed that contains a ‘Graphics’ menu and an ‘Audio’ menu.
The graphic and audio settings are set up already so the player can alter settings and store those settings between levels and different sessions of the game.
Specifically for the audio, the player can adjust the ‘Master, Music, and SFX’ volume. That all works fine.
Though, there seems to be an issue with a ‘ghost’ sound effect when the player clicks the ‘Options’ button. (See attached video) Even after I have removed all ‘Play Sound 2D’ nodes between the click of the ‘Options’ button and when the ‘WidgetSwitcher’ is constructed, the sound still plays and it plays at a much higher volume than the rest of the my sound effects.
I did some troubleshooting with a friend. They were positive it was a double sound being played somewhere, but eventually we seemed to have ruled that out.
I was able to find a piece of code where the sound doesn’t play, and that’s when I remove the ‘Set Active Widget Index’ (see attached screenshot).
The ‘WidgetSwitcher’ has no code inside of it. It’s only a vehicle for the ‘Graphics’ and ‘Audio’ menus.
Additionally, if I go to the ‘Graphics’ or ‘Audio’ menu and detach ‘Event Construct’, the sound doesn’t play anymore. This code just loads settings that the player stored in persistent storage.
My current line of thinking is that maybe it’s being saved in storage somehow. If that is the case, how do I remove that from storage and prevent it from storing it again?
Anyone have any other ideas about this? Thanks in advance!