question

tomassvedin avatar image
tomassvedin asked

How to use GetPlayerStatisticsRequest in Unity?

Can someone show me how to use GetPlayerStatisticsRequest? I have successfully posted player statistics but I have no idea how to retrieve them..

This is what I do to post stats:

List<StatisticUpdate> statsList = new List<StatisticUpdate>();

  StatisticUpdate killStat = new StatisticUpdate();
  killStat.StatisticName = Constants.STATNAME_KILLS;
  killStat.Value = kills;
  statsList.Add(killStat);


UpdatePlayerStatisticsRequest request = new UpdatePlayerStatisticsRequest()
  {
  Statistics = statsList
  };

  PlayFabClientAPI.UpdatePlayerStatistics(request, (result) =>
  {
  Debug.Log(">>> Player Stats posted to PlayFab successfully.");
  }, (error) =>
  {
  Debug.Log(error.ErrorMessage);
  });
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

There's a good example of its use in this post: https://community.playfab.com/questions/6523/unity-public-static-void-getuserstatistics-isnt-sh.html. Could you have a look at that and see if it helps?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.