- Home /
adding scores and creating a leaderboard
Hey everyone, Im designing a maze game where the quicker you complete the level the better. I have a GUI timer all set up and works brilliantly! I would like the time from each level saved onto a leaderboard, with a total at the bottom.
I would also like there to be an way to allow people to write their names on to the leader board. Any help will be placed on my credits and will be much appreciated!
Answer by hathol · May 14, 2012 at 05:04 PM
The easiest way would be to just store the values and the username using PlayerPrefs http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html with the level name as the key. In case you don't need more than one entry per level, that should be fine.
Alternatively, you could serialize the data with C# System.IO tools though that won't work with the web player. Other solutions include using online databases that you can access via WWW http://unity3d.com/support/documentation/ScriptReference/WWW + http GET/POST calls or using a local database solution (something like Sqlite though there's apparently issues with that one and I never tried it myself tbh.)
Your answer
Follow this Question
Related Questions
Help! Why doesn't this work? GUI/Static vars Help! Javascript 1 Answer
Coin Counting Problem 0 Answers
High Score on Mobile 1 Answer
Unity3D WWW takes URL from address bar 1 Answer
Overwritting score with GUI 1 Answer