I was wondering how I could get the number 1 score on top of the leaderboard as a var in Unity.
Cheers
I was wondering how I could get the number 1 score on top of the leaderboard as a var in Unity.
Cheers
Calling GetLeaderboard with the StartPosition set to 0 will always return the top entries in the leaderboard, as shown in the example, here: https://api.playfab.com/Documentation/Client/method/GetLeaderboard.
So is that StartPosition?
On a slightly seperate note, it says that that is an int32, does this mean a highscore cannot be a float?
Sorry, yes - StartPosition. I'll update the response above, to clarify. And yes, as in other services like PSN and XBL, leaderboards are generated from int values. If you want to have floating point values, you would need to store them using an int value (multiplying them, for instance), and then do the math conversion when displaying the scores to the player.
Oh hold on a minute, just rereading your first comment, just to clarify, will returning start position 0 just get me one int value which is number 1 (or technically 0) on the leaderboard as a var?
Ah okay, so if I did (obviously this isnt correctly written, but Im sure you get the idea):
var TopScore = GetLeaderboard.Position.0
Then TopScore would = 3
No one has followed this question yet.