Persistent Settings

Persistent Settings are a way to permanently set levels of music and sound effects. You can for instance set - permanently - the global volumes at top of the Master Audio game object (Master Playlist Volume, Master Mixer Volume), as well as Sound Group & Bus volumes. Setting a "Persistent Volume" means that you are setting the volume of ALL Master Audio game objects in future Scenes as well as the one in the current Scene, if any. The API is as follows:

  • Set Master Mixer Volume to 50%
    PersistentAudioSettings.MixerVolume = 0.5f;

  • Set Master Playlist Volume to 70%
    PersistentAudioSettings.MusicVolume = 0.7f;

  • Set Sound Group "Arrow" volume to 40%
    PersistentAudioSettings.SetGroupVolume("Arrow", .4f);

  • Set Bus "Dialogue" volume to 80%
    PersistentAudioSettings.SetBusVolume("Dialogue", .8f);

  • Mute mixer (all SFX)
    PersistentAudioSettings.MixerMuted = true;

  • Mute all music
    PersistentAudioSettings.MusicMuted = true;


Note: Our versatile Event Sounds script can also set Persistent Volumes and more for you from a wide variety of Unity events without you having to write any code!