- Home /
Question by
JimmyCushnie · Jul 07, 2017 at 09:04 PM ·
soundmusicvolume
How do I have separate volume sliders for sound fx and music?
I'm using AuidoListener.volume to control the global volume of my game via a slider. Is there a way for me to have a volume slider that effects all sound except some audio sources that I explicitly exclude (i. e. music)?
Comment
Best Answer
Answer by FlaSh-G · Jul 07, 2017 at 09:07 PM
Don't use AudioListener.volume, it's for the overall volume. Don't use AudioSource.volume either, it will get hairy pretty quickly.
Instead, use AudioMixers. They're designed for exactly this kind of stuff and work excellently. Here's a tutorial: https://unity3d.com/de/learn/tutorials/modules/beginner/5-pre-order-beta/audiomixer-and-audiomixer-groups