Search Unity

How to create a timed score?

Discussion in 'Editor & General Support' started by Nathanaji01, Mar 12, 2019.

  1. Nathanaji01

    Nathanaji01

    Joined:
    Oct 8, 2017
    Posts:
    24
    Hi.
    I am beginner and I am making a game in which the character has to run away from some enemies. The goal of the game is to survive for the longest amount of time. I wanted to know how to make a stopwatch in the corner of my game, when I go to the main menu and return to the game it saves the high score and displays it in the corner. I have the actual game and the menus made but not the socring system. Please help.
    Thanks
     
  2. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    Look up PlayerPrefs. That's where you can save scores for closing/reopening. It's easy-to-use and was like striking gold for me. For the time/score just update the "Score" UI with a score int that counts up in FixedUpdate().