Volume not changing but shows it has

My log shows I have set the volume to the desired lvl but the volume in my game does not change, nor do the volume controls on the editor mixer. Any ideas what I am doing wrong, Im getting no errors but also no visible affect? This is called on value changed from a slider, the console log shows the correct name and values

    public void ChangeVol(string name, Slider vol)
    {
        mixer.SetFloat(name, vol.value);
        float currentlvl;
        mixer.GetFloat(name, out currentlvl);
        Debug.Log("Changed " + name + " to " + vol.value + ". the current mixer lvl is " + currentlvl);
    }

Double check that the values of the variables “mixer” and “name” are both exactly correct.

I have, Ive been starring at that part for the past hour, the bit that is confusing me is when i call back to the mixer with GetFloat it shows the new value has been set. I presume GetFloat would fail if it didnt find a mixer?, I also checked I had the correct mixer with the name tag and that came back correct as well.

But are you sure this is the mixer what you expect it to be? I mean you can have multiple mixers.

Did I miss something, its the name I gave to the exposed parameter that I am using in my code

Just the one mixer, I had checked its name earlier and that showed up and Main

What does the Debug.Log you made in your ChangeVol method says? Could you please paste it here?

BTW, please attach the images to your post here, not on third-party services, you can embed them into your post too, it’s easier to overlook what’s happening. You can upload images whhen you click upload a file button.

Yeah I had missed something the code was fine, the range of my slider however was not. lol the daft things always take up the most time.

1 Like