Hello I have a problem. I need to show in leaderboard in game not only score, I need more values like player level. No problem with send data, but how get data for every players?
I get leaderboard like this: (Unity)
foreach (var item in result.Leaderboard){ ...firstly made line with values lineLb[0].text = (item.Position + 1).ToString(); lineLb[1].text = item.DisplayName lineLb[2].text = item.StatValue.ToString(); }
Something like item.Profile.TitleData[1].value.ToString(); would be very cool for me.
Answer by Gosen Gao · Aug 19, 2021 at 03:34 AM
You could create another Leaderboard like “Level” to store player level. When you want to get Leaderboard of “Score”, you can add the parameter ProfileConstraints in the GetLeaderboard request body and set ShowStatistics to true, then it will return all the statistics of each player in Leaderboard “Score”.
But it is important to note that Statistics in Profile are not allowed to be read by the client by default. So before you call again, please navigate to [Game Manager]->[Title Setting]->[Client Profile Options]->[ALLOW CLIENT ACCESS TO PROFILE PROPERTIES]. And make sure the option “Statistics” is selected.