0
\$\begingroup\$

I use the ui slider to control how loud is the game, what I want to know is how to make one ui slider control all of the game audio?

\$\endgroup\$
1
\$\begingroup\$

http://answers.unity3d.com/questions/16603/is-there-a-global-volume-setting.html

Use the slider's value to determine the AudioListener.volume static field.

http://docs.unity3d.com/ScriptReference/AudioListener-volume.html

It is between 0 and 1. You can get a normalised( between 0 and 1 ) value from the slider using Slider.normalizedValue.

\$\endgroup\$
  • \$\begingroup\$ Can you write down the code for me? \$\endgroup\$ – Bob Jun 30 '15 at 9:21
  • 2
    \$\begingroup\$ I'd like a sandwich as well Ben, while you're doing Bob's homework :) Seriously now Bob, Ben provided a very detailed answer already, show some interest in your own work, will ya... \$\endgroup\$ – Mihai-Andrei Dinculescu Jun 30 '15 at 9:26
  • 1
    \$\begingroup\$ I just checked his profile... Pretty much every question is downvoted... thats pretty impressive \$\endgroup\$ – nickson104 Jun 30 '15 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.