- Home /
Duplicate Question
How to save of a variable between scenes
Hi i am making a toss type game and im keeping track of distance between 2 objects but im having trouble saving that number across scenes i tried attacthing this script DontDestroyOnLoad(gameObject);
to the distance tracking object but that doesnt work it just gives me the error "object reference not set to the instance to an object" any help is appreciated thank you in advance
Answer by Jeff-Kesselman · May 27, 2014 at 08:30 PM
This has been asked many, many times.
Did you search the questions before asking?
http://answers.unity3d.com/questions/13130/scene-to-scene-variables.html
http://answers.unity3d.com/questions/182491/remembering-variables-between-scenes.html
http://answers.unity3d.com/questions/41891/static-variables-between-scenes.html
etc
Follow this Question
Related Questions
StreamReader returning incorrect results 0 Answers
On carachterspawn level load error? 0 Answers
Save Timer HighScore 1 Answer
Map an Image onto an object from a URL 0 Answers
Camera help 2 Answers