Sign In Register

How can we help you today?

Start a new topic

Unity - Create leaderboard with top 10 users and you.

Hi,


I am just starting to use GameSparks and wanted to create a leaderboard that just shows me the top 10 users and then myself. If I am part of the top 10, then it will only show 10 entries, otherwise it will show the 10 followed by me.


I have the leaderboard working now with showing 10 entries, but am wondering how to get mine displayed accordingly?

1 Comment

Hi David,


There are a couple of ways you could accomplish this. 


You could use an AroundMeLeaderboardRequest, setting the entryCount to 1 (which will give your entry+ 1 surrounding entry) and the includeFirst to 10 (top 10 entries from the lb).


Alternatively, you could perform a LeaderboardDataRequest with entryCount set to 10 for the top 10 players, then a GetLeaderboardEntriesRequest with the shortcode of the leaderboard you're checking in the 'leaderboards' field to the current player's entry.


Try these out and let us know how you get on


Regards,

Vinnie

Login to post a comment