Hi All,
Been struggling with this one all weekend now and I can’t seem to figure out whats going on. So basically I looked at the code on the GitHub page for the Google Play Services package and followed the example they put for loading leaderboard data. However, despite me already having scores posted, it seems as though the Social.LoadUsers cant get user data. See my code below…I’ve also posted a screenshot of my Google Play Services leaderboard (the one i’m passing as _LB_ID)
internal void LoadLeaderboardUsers(string _LB_ID)
{
ILeaderboard _Leaderboard = PlayGamesPlatform.Instance.CreateLeaderboard();
_Leaderboard.id = _LB_ID;
// Get the user IDs
List<string> _UserIDs = new List<string>();
// Access the score data
PlayGamesPlatform.Instance.LoadScores(
_LB_ID,
LeaderboardStart.PlayerCentered,
100,
LeaderboardCollection.Public,
LeaderboardTimeSpan.AllTime,
(data) => {
_LoadingScores.text = "Got here: " + data.Scores.Length.ToString();
_UserIDs.Add(data.PlayerScore.userID);
}
);
_LoadingScores.text = "User Length : " + _UserIDs.ToArray().Length.ToString();
Social.LoadUsers(_UserIDs.ToArray(), (Users) => {
foreach(IScore _Scores in _Leaderboard.scores)
{
IUserProfile _User = FindUser(Users, _Scores.userID);
GameObject _Player = Instantiate(_LeaderboardPlayerPrefab, _LeaderboardPanelContentArea);
//_Player.GetComponentInChildren<Image>().sprite = Sprite.Create(data.PlayerScore.im, new Rect(0, 0, 80, 80), new Vector2(0.5f, 0.5f));
_Player.GetComponentInChildren<TMP_Text>().text = _User.userName + "\nScore: " + _Scores.formattedValue + "\n";
}
});
}