// Make this game object and all its transform children
// survive when loading a new scene.
function Awake () {
DontDestroyOnLoad (transform.gameObject);
}
Right, for manager scripts that should survive the whole game that's the right way.
If you want to save the value even across multiple game sessions use PlayerPrefs.
To save your “exp”:
PlayerPrefs.SetFloat("currentXP",exp);
To load it:
exp = PlayerPrefs.GetFloat("currentXP",0);
The "0" at the end is the default value that is returned if it hasn't been saved yet. You can use any name you like to save values but it should be something you can remember ;)
Right, for manager scripts that should survive the whole game that's the right way.
– Bunny83