Scroring after scene reload

In the lecture the scoring is reset as the scene reloads. But how can I make it go on in this case (and even through several scenes) so that it still adds up after death or level change?

It seems that an empty object with scoreboard pattern may work, but will it be kept through different scenes?

There’s a couple of ways to do it. You could save the data OnDestroy and load it in the next scene.

Another way, would be DontDestroyOnLoad(this.gameObject) so the score persists through multiple scenes.

1 Like

Yeah, public method + singleton worked pretty well

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms