I'm trying to make some audio settings. Here is my script:
public AudioMixer masterMixer;
public float masterLvl;
public float musicLvl;
public float sfxLvl;
public void SetMasterVolume ()
{
masterLvl = masterVolumeSlider.value;
masterMixer.SetFloat("masterVol", masterLvl);
}
public void SetMusicVolume()
{
musicLvl = musicVolumeSlider.value;
masterMixer.SetFloat("musicVol", musicLvl);
}
public void SetSfxVolume()
{
sfxLvl = sfxVolumeSlider.value;
masterMixer.SetFloat("sfxVol", sfxLvl);
}
It has all the OnValueChanged(); things on the sliders. I just want to know why this doesn't work. Thanks.
EDIT: So the thing is that it changes the dB, not the volume. The new question is: How do I make it change the volume instead of dB?