How can I make the in-game menu remains unchange while changing scenes?

Hi all,

This may be asked already, but I couldn’t find the right answer. I’m developing a storybook app using Unity’s 2D platform, and it seems to be a platform of choice for me. As I started developing it, I have the main menu done no problem and adding new scenes is fine too. But I got to the part where I want the previous page button, next page button, and options menu (to adjust FX and/or music volume) that I have created for the app in the first scene to remain on every scene. I know that every scene has its own camera, thus I can only create these same buttons and menus on every scene. Is there any other way to create them only one time and reuse them on other scenes?

Thank you!

Is this the hourly http://docs.unity3d.com/Documentation/ScriptReference/Object.DontDestroyOnLoad.html thread?

I tried this by attached the JS script on a button on my first scene. It still got deleted.

You should create a gameobject with a class that holds the values of settings and add “DontDestroyOnLoad(this.gameObject)” inside Awake method.

public class SettingsValue : MonoBe...{

     public float sfxVolume, musicVolume;

     void Awake()
     {
          DontDestroyOnLoad(gameObject);
          if (GameObject.FindObjectsOfType(GetType()).Length > 1)
      {
	    Destroy(this.gameObject);
      }
     }
}

You should set the values in your scene where you have the gui menus.