- Home /
Creating a scoreboard
Hi there im making a race game.
When you reach the line, the timer stops, this is your score.
The player can get collectable through the race that takes off times.
How could I create a scoreboard popping everytime you reach the end showing the 5 best score, including your name.
I dont know where to begin with, please help me.
THX
Answer by Berenger · May 16, 2012 at 04:12 PM
The scoreboard will likely be drawn with GUI. For that, you need a script enabled attached to a gameObject, implementing the function OnGUI(). Inside, you can use GUI.XXX functions to draw labels, box, buttons etc.
The poping thing will be, in the simplest form, a boolean set to true. It will belong to the gui script, and you need to test if it is true before drawing anything. For something fancier, you can animate a float to change the alpha, or use iTween to make the board move.
ok yeah,thank you Berebger
Im already implementing my Avatartimer with GUI, so it should not be a problem. But how to show all scores, I mean what can I do to keep track of the best times.