How do I save my score to the next scene in a endless runner game.
I want my player to go to the next scene when he reach certain scores and that the score continues in the next scene. I was thinking about a "Don't Destroy" function, but I am having problem with it.
Search around for Singleton should do what what you are trying to do. If i remember correct it is used in some Unity tutorials. Or check the DontDestroyOnLoad function (Note: it is used in singleton code anyway).
Answer by saud_ahmed020 · Dec 22, 2016 at 12:56 PM
@dasani2406 You must save the score in Player prefs. Just Follow the given links!!!
Set Score: https://docs.unity3d.com/ScriptReference/PlayerPrefs.SetInt.html
Get Score: https://docs.unity3d.com/ScriptReference/PlayerPrefs.GetInt.html
@dasani2406 If you found it helpful then kindly accept the answer and vote it. Thanks