Saving settings between scenes !

Hi everybody !

I have a mute script attached to a “Settings” scene. How I can use the playerprefs to save and work in another scene ? I tried very much solutions but nothing is working … :frowning:

Here is my script:

#pragma strict
 
  var muted = false;
  var CustomSkin: GUISkin;
  var musicMute : GUIStyle;
  var allSound : GUIStyle;
  
  
   function Start (){
 
   }
 
  function OnGUI(){
      GUI.skin = CustomSkin;
     
      if(GUI.Button(new Rect(Screen.width * 0.20,Screen.height * 0.40, Screen.width * 0.20, Screen.height * 0.20), "Sound"))
      {
          if(muted == false){
          AudioListener.volume = 0;
          muted = true;
          }
          else{
          AudioListener.volume = 1;
          muted = false;
          }
      }
  }

to save volume
PlayerPrefs.SetFloat(“audioVolume”, AudioListener.volume);

to retrieve the volume
AudioListener.volume = PlayerPrefs.GetFloat(“audioVolume”);

1 Like

Don’t work how he’s suposed to do :frowning: !

Done :smile: !