i developed a game space shooter i set a condition when player reached
1. enter code here
i developed a game space shooter i set a condition when player reached 1000 score the game move to next level the problems is when we go to next level my score is begin with zero i want to start move level with increasing score not started from from zero
Answer by alankemp · Jul 14, 2017 at 12:20 PM
Here are two ways you could do that.
Use PlayerPrefs
Before you leave the level, save the score into player prefs. After you load the next level, reload the score.
Have an object marked with DontDestroyOnLoad
All your objects are being destroyed when you load the new scene, including the one that contains the current score. You could create an object that stores information like the score and use DontDestroyOnLoad to make sure it is still around after you load the next scene.
Your answer
Follow this Question
Related Questions
Unity/C# Respawn and score Problem 1 Answer
Can't update score text - small error breaks the game (Space Shooter Tutorial) 1 Answer
In updating some score text, why should we use the Update function instead of separate functions? 0 Answers
Help making a high score with player prefs/displaying it 1 Answer
Saving Highscore Per level 2 Answers