Get scores for other players
Retrieve scores for specific players in a leaderboard.
Read time 1 minuteLast updated 21 days ago
Get the scores for other players in the specified leaderboard with the
GetScoresByPlayerIdsAsyncpublic async void GetScoresByPlayerIds(string leaderboardId){ var playerIds = new List<string>{ "abc123", "abc456" }; var scoresResponse = await LeaderboardsService.Instance .GetScoresByPlayerIdsAsync(leaderboardId, playerIds); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}
To get the score with any associated metadata, use the
IncludeMetadataGetScoresByPlayerIdsOptionspublic async void GetScoresByPlayerIdsWithMetadata(string leaderboardId){ var playerIds = new List<string>{ "abc123", "abc456" }; var scoreResponse = await LeaderboardsService.Instance .GetScoresByPlayerIdsAsync( leaderboardId, playerIds, new GetScoresByPlayerIdsOptions { IncludeMetadata = true } ); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}