|
Ok so I have a character that has a money and score variable that I would like to keep the same value when I load another level/scene. Whenever I load the character the values revert back to their origonal defaut settings of zero. Is there any way to maintain the score/money variable when I change levels? If whoever answers this could use JS that would be really helpful.
(comments are locked)
|
|
Static variables will persist through scenes:
Just remember that the variable will be shared between all instances of the script
(comments are locked)
|
|
You can also look into PlayerPrefs for keeping such info of your player.
(comments are locked)
|
