I have this mixer with music and effects. But I see in each of the groups that the volume top start from 20 5 0 then in the bottom 80. The logic I think should be at the top 80 and at the bottom 0 ?
My questions are, How to make that on the sliders on the most left side it will be 0 no music/effects sound at all ? And on the right more and more louder ?
And how can I display near each slider the volume value when changing the volume while the game is running ?
Then in the Hierarchy I have two Sliders that change the volume one for the music one for the effects.
And then while the game is running when I’m changing the volume of the Music or Effects in my logic the louder should be on the most right side and less louder or mute on the left side of the slider but it’s on 0 or close to 0 just a bit before the most left right side and if I move it more to the left it will be louder again:
This is where the music is more or less on 0 if i move it more to the left it will be louder again:
This is the script I’m using on each Slider in the: On Value Changed I’m calling The method SetMusicVolume or SetEffectsVolume:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.Audio;
//[System.Serializable]
public class AudioManager : MonoBehaviour
{
public Slider musicVolume;
public Slider effectsVolume;
public AudioMixer audioMixer;
public void SetMusicVolume()
{
audioMixer.SetFloat("musicVol", Mathf.Log10(musicVolume.value) * 20);
}
public void SetEffectsVolume()
{
audioMixer.SetFloat("effectsVol", Mathf.Log10(effectsVolume.value) * 20);
}
}


