How do you script volume control for music and sfx buses

I have my music and sfx on two separate buses in fmod. I want to be able to have the player change the volume settings for these via the pause menu in my game. How would I go about scripting that (C#)?

In trying to solve my own problem I got as far as this link, but I don’t know how or where to put it in my script.

Thanks in advance guys.

It is fairly easy, once you have a reference to the bus you can then adjust the fader level:

 string masterBusString = "Bus:/";
 FMOD.Studio.Bus masterBus;
 masterBus = FMODUnity.RuntimeManager.GetBus(masterBusString);
 masterBus.getFaderLevel(out float);

This fader level is relative to the fader level set in FMOD Studio.
Then it is up to as to how you want to expose/control it.

1 Like

Ah ok, that makes sense. Thanks!

Thanks! This really helped me too!

Same here! I wonder why they don’t just put an example like this in the Documentation.

1 Like