The question is answered, right answer was accepted
A way to tell the player what they scored in the next scene
Hi i created a 2d platformer in C# where the player picks up an item to up there score at the end i have it to go to the next scene and i want the score out of total possible score to be displayed i have tried several different ways but have not found one that works if anyone know how to do this or where i should start please let me know i will much appreciated
(I am new to coding, Unity and game deign if i'm asking this poorly or in the wrong place i apologize and would be thankful to be pointer in the right direction )
Answer by Kiefy · Jan 03, 2017 at 09:01 PM
You can use PlayerPrefs or a DontDestroyOnLoad()
In the case of PlayerPrefs. You can save with PlayerPrefs.SetInt("Player Score", myScore);
then loading in the next scene with myScore = PlayerPrefs.GetInt("Player Score");
Or for DontDestroyOnLoad. Simply pass it the GameObject that has your score script attached. DontDestroyOnLoad(MyScoreManager.gameObject);
Follow this Question
Related Questions
Help with 2D platformer (score),For my 2D game sometimes coins get added twice to the score?! 0 Answers
In the next scene tell player there score out of total using player prefab before next level 1 Answer
KillPlayer, Null Reference Exception. 2 Answers
Unable to Compile scripts on my game but my Team mates can on their machines?CS0103 0 Answers
Score system using prefabs in C# 0 Answers