- Home /
Volume slider not working properly for SFX group
Hi! I've been working on a game for a while and now I'm working on a volume slider for the music and sounds effects (sfx)... but there is a problem, for some reason the sfx volume slider does nothing for the sound effects volume, even if it's shown in the inspector that the corresponding volume for the group mixer is at minimum, even weirder if you turn down the volume for the music slider the sfx volume gets turn off!
If I just make one slider for the master volume and add all the audio clips to that group that solves the problem (in a way) but I still don't want to give up on this! so if anyone can help me figure out how am I messing out I'll will really appreciate that :)
I'll add a video showing how the audio works in my game and also the problem for reference https://youtu.be/Zs70VsygxDo
Answer by danicond97 · Jul 13, 2021 at 08:33 PM
Hi! I just fixed the problem... in a way since I still don't know why it behaves that way but there is a workaround for that and my solution was to play sfx sounds with play() instead of playoneshot() in the script... yeah that was it!
My intension was to not let each sfx sounds to replace each other but that is more of a development choice than a behavior I expect, so I can live with that.
Answer by KarMa_PlaYzz · Jul 09, 2021 at 08:30 AM
Maybe this Audio Tutorial will help you
It explains how Audio mixers/groups work and will also show you how they work in code
Hope this helps!
Hi, actually my audio manager is based on that brackeys video hahaha, the only difference is that I use playoneshot() instead of play() since I don't want the sfx sounds in my game to replace each other
Your answer
Follow this Question
Related Questions
Sound distorted on impact. 1 Answer
Cant repeat Sound 1 Answer
Play sound when enemy is visible on the screen? 1 Answer