Search Unity

Change Mute Audio For BGM/SFX using AudioMixer

Discussion in 'Scripting' started by Tatsumi-Kun, Nov 20, 2016.

  1. Tatsumi-Kun

    Tatsumi-Kun

    Joined:
    Feb 11, 2015
    Posts:
    130
    I trying to mute or disable BGM according to what the player wants by using a toggle button but the BGM/Sfx Still playing I try this line of code...
    Code (CSharp):
    1.  
    2. MasterAudio.SetFloat("Music", 0f);
    3.  
    so it can mute the BGM and do the same for Sfx and then save it for the other scenes.
    but nothing seem to work... i also try snapshot too but i don't understand it cause if i create a snapshot to mute the BGM, i can have the Sfx playing or unmute, and Sfx mute and BGM unmute, but if the player want to mute all now how am i going to make a snapshot to mute all audio when both toggle is selected.