How to carry variables over levels

So I have multiple levels in my project, and in the main level I want it so that when the player dies the current values of certain values stay the same when in the other level.

For example, if one level had a money system and you progress through the game and go to the next level I want the money to remain the same.

It could be used as a replay from a checkpoint so you don’t have to play the whole level again.

Any idea on how to do this?

You can do that by storing vrables in GameInstance which is not reset on level restart or level change, here some tutorial explaining that

1 Like

Thank you so much! I really needed this

If you want a more integrated example of this I have a beginner series that does this with player score obtained from collecting coins within the levels. I show you how to track this value through 2 levels and transition from one level to the next once all the coins have been collected. There are also a bunch of other tutorials in the series you may be interested in if you are just getting started.