Fetch Leaderboard Entry Count

Hello!

I am using Nakama 3.24.2-r2 on Heroic Cloud. The unity SDK version is 3.14 and we’re still having issues using the RankCount property for the IApiLeaderboardRecordList interface. It is only returning null, even though I have entries in my leaderboard.

This is the code I’m using:

IApiLeaderboardRecordList resultAll = await client.ListLeaderboardRecordsAsync(session, config.CashLeaderboard);

int count = int.Parse(resultAll.RankCount);

Debug.Log("Leaderboard Records count: " + count.ToString());

Please let me know what I’m doing wrong or how we can pull the count of the entries in the leaderboard.

Hello @SarahNicole,

Were these leaderboards created before v3.23.0 ?

If not, starting from that version there’s a new enableRanks param that has to be set to true to enable rank computations on new leaderboards being created.

Hope this helps.