How can i save a variable for only one scene?

I am using the same scripts for all my scenes, and I have a variable balance, when I save it in playerprefs , all my scenes have the same balance when I load it, but each scene is a different world, each world should have a separate balance, can i save the variable balance for each scene individually, or do i have to make separate scripts for each scene???

forgot to mention my balance variable is in my gamemanager script

Hey you!

If you’re wanting to save each level score using PlayerPrefs like that, what you could do is instead of making multiple scripts, just change the name used for the score in PlayerPrefs. For example:

Level1_Highscore: 100
Level2_Highscore: 0
Level3_Highscore: 0
...

So, you could just make the name of your PlayerPref variable, well, a variable. Perhaps a public variable that you could set in the inspector. With this, you could go to that script in each scene, and just set the different name in the inspector. Kinda make sense? Hopefully that’s useful.