Get a range of scores centered around the player

To get the entries of the player as well as the specified number of neighboring players ranked on either side of the player, use the GetPlayerRangeAsync method:

C#

public async void GetPlayerRange()
{
    // Returns a total of 11 entries (the given player plus 5 on either side)
    var rangeLimit = 5;
    var scoresResponse = await LeaderboardsService.Instance.GetPlayerRangeAsync(
        leaderboardId,
        new GetPlayerRangeOptions{ RangeLimit = rangeLimit }
    );
    Debug.Log(JsonConvert.SerializeObject(scoresResponse));
}

To get the score with any associated metadata, use the IncludeMetadata option in the GetPlayerRangeOptions configuration object:

C#

public async void GetPlayerRangeWithMetadata()
{
    var scoreResponse = await LeaderboardsService.Instance
        .GetPlayerRange(
            leaderboardId,
            new GetPlayerRangeOptions() { IncludeMetadata = true });
    Debug.Log(JsonConvert.SerializeObject(scoreResponse));
}

Metadata is not retrieved by default.

For methods that retrieve scores: if your player has not submitted a score and the leaderboard is bucketed, the player is not assigned a bucket. A failed score retrieval returns an error that has its Reason field set to ScoreSubmissionRequired.