Scoring across different levels

I have a scene score that works perfectly but when the player enters say level 2 the score resets to 0.
I know that you use a global variable to score through levels but I seem to be getting it wrong somewhere.
I created a scene score which I named Scene_Score and then created a Global Variable that I named Global_Score.
But the |Global Variable for some reason dosen’t seem to work these are the events from both level

Level 1

Level 2

If anyone could point out where I am going wrong I would be really grateful

Is there a reason you need both a global score AND a scene score?

Right now at the beginning of the scene you’re setting the scene score to 0 and then setting the global score to the scene score (which you just set to 0).

If you want the global score to be a cumulative I’d all the scene scores, then at the END of the level you’ll want to ADD the scene score to the global score.

Do you change your “Global_Score” at the end of the scene to the “Scene_Score”? If not, it will just remain at 0 which you set at the beginning, it doesn’t update as the “Scene_score” gains points. Just set the “Global_Score” to the “Scene_Score” or add “Scene_Score” to “Global_Score” at the end of the level so that score will carry over to the next scene. Then, repeat the adding of the Scene_Score" at the end of each level. You can save “Global_Score” to file if you want to retain that for the next time your game is played as well the end of your levels.

1 Like