Hi,
I've been trying various methods of toggling my game's sound and music separately but am now completely stuck. I can get the title screen music to toggle but as soon as the game starts, music starts playing again. I also can't toggle sound effects on and off using 'set muted/paused' despite including tags.
drive.google.com/file/d/1kqSfBAP1h2SeuKurt91OIFyqJryO3giB/view
I saw that you used many different tags for sfx.
You should group sfx in same tag like "gameSfx".
And "gameMusic" for music background in your game.
It will be easier for you can manage many sfx and music.
Thanks Maverick1912,
I changed the tags but the issue is still there. The sound effect don't toggle on/off and music still plays when I start the game even though I can toggle it on the title screen.
Develop games in your browser. Powerful, performant & highly capable.
It might be a convenience solution, but what I mostly do in larger projects with sounds, where the sound is optional... is wrap the play sound and play music in a function. I pass in the tag to the function, and the function only plays the sound or music if a global variable is set to true or something. First thing the game should do of course is get the setting from local storage, before the the sound starts playing
hope it helps?
Cheers