How to create a currency pool that is tied to game score?

Hello! So, I’m trying to make a small personal project where the currency in the game shop is just the score that the player accrues in the game. My issue right now is that i need the number in the shop scene to be saved forever because i want the score from the game scene to just add up to the shop every time the game is played. At the moment, the two numbers are pretty tied together in that the number in the shop also resets to zero every time new game is triggered in the game, since the game is programmed to start at score = 0. So i need ideas on how to:

  • make the shop number stay
  • add the game score to the shop score pool

Any ideas would be appreciated!

Am immediate lazy and working solution is to save the value in PlayerPrefs , you can read the documentation to get an idea bout what it does , but basically it saves the data somewhere in your PC , so the data persists between scenes and game runs and you can reach it at any point.
A more long term solution would be to create a save/load system and to save the persistant stuff to a JSON file or something.

Data persistence is a big topic and there are several ways to go about it. Unity’s PlayerPrefs system is a good place to start and based on your description it might suit your needs. I’m sure a quick a search on YouTube or google will yield a wealth of tutorials.