Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(-1)

I followed this tutorial video to implement the scoreboard:

But I'm not displaying the scores, only loading the scoreboard, because I don't want my game to display them all, just the player's personal score. So, I haven't included the loops shown in the video, just the function, and an empty version of the "LeaderboardCreator.GetLeaderboard" condition.


At present, I just have the function showing the top three scores, for the sake of testing, but my next step is to access the player's personal score and display that (which I'll then use to get the scores ranked directly above and below it).


So far, the condition looks like this:

LeaderboardCreator.GetLeaderboard(publicLeaderboardKey, ((msg) =>

        {

            

            rank1text.text = "#" + msg[1].Rank.ToString();     //Set the highest displayed rank

            rank1nameText.text = msg[1].Username;       //Set the highest displayed rank's name

            rank1scoreText.text = msg[1].Score.ToString();       //Set the highest displayed rank's score

            rank2text.text = "#" + msg[2].Rank.ToString();     //Set the middle displayed rank

            rank2nameText.text = msg[2].Username;       //Set the middle displayed rank's name

            rank2scoreText.text = msg[2].Score.ToString();       //Set the middle displayed rank's score

            rank3text.text = "#" + msg[3].Rank.ToString();     //Set the lowest displayed rank

            rank3nameText.text = msg[3].Username;       //Set the lowest displayed rank's name

            rank3scoreText.text = msg[3].Score.ToString();       //Set the lowest displayed rank's score

            //bool isMine = msg.IsMine();

            //Debug.Log(msg.IsMine().Score);

            //Debug.Log(LeaderboardCreator.GetPersonalEntry(publicLeaderboardKey, Whatever goes in here));

        }));


You can see lines I've commented out. These were my attempts to use IsMine() and GetPersonalEntry, but every attempt gave me an error.