score passed between scenes

Hey guys,

I have a PlayerGamePrefs script in a scene that loads the PlayerPreferences and assigns the values to variables. But in another scene, I can’t access these variables. The variables are public static, but I can’t access them without errors. Is there an easy way to pass these values across scenes?

Thanks.

Have you called DontDestroyOnLoad during the script to make sure that the gameobject containing it will still exist when another scene is loaded? I think that’s necessary to get variables passed into the next scene.
http://docs.unity3d.com/Documentation/ScriptReference/Object.DontDestroyOnLoad.html