Search Unity

Put Highscore in each Scene with Saving

Discussion in 'General Discussion' started by achsuthan4321, Feb 17, 2020.

  1. achsuthan4321

    achsuthan4321

    Joined:
    Feb 17, 2020
    Posts:
    1
    hi,
    i have a problem with highscore saving, i create a game with many levels but when i play in each level , i always saw the same highscore. i don't know how to put and saving highscore for each levels in C#.
    Would you help me plz? thank you

    PS : sorry for my english , i'm french.
     
  2. mcmount

    mcmount

    Joined:
    Nov 15, 2015
    Posts:
    83
    Use the playerprefs, saves /reads anything to registry at ease, one line of code;
    saving: PlayerPrefs.SetInt("myscore", score);
    loading: score=PlayerPrefs.GetInt("myscore");