question

gregustamas avatar image
gregustamas asked

,How to post user points to a certain leaderboard and get the leaderboard back in Unity?

I can't find any tutorials about how to make this, but I want to be able to do the following:

The user should be able to post the score to a certain leaderboard named Ranking. (without Facebook or any other registration...yeah, I don't need any password management, anything at all. Just the user should write the username and his points would post to the leaderboard). So I don't need any authentication.

Maybe this still needs LoginWithCustomId, but I'm also not sure about that.

And I want to be able to get the certain Leaderboard datas (username and point, only two datas would be enough for one player).

Sadly I can't find any tutorials for the PlayFab. This tutorials are unusable for me, UpdatePlayerStatistics has no parameters for identifying the username at all, or I don't understand anything about this:

https://api.playfab.com/platforms#unity

I also can't see the difference between UpdateUserData and UpdatePlayerStatistics. I couldn't refresh the player's score with any of them. Maybe I just don't know how to use them.

Please help me and provide me some examples.

Player Dataunity3dLeaderboards and Statistics
2 comments
10 |1200

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

gregustamas avatar image gregustamas commented ·

https://imgur.com/a/vyl43

This is the Value I would like to update from code. But this code does nothing:
https://pastebin.com/D9ACMPdp

0 Likes 0 ·
gregustamas avatar image gregustamas commented ·

I solved this.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

For the sake of others with the same or similar questions:

1. Yes, to make any Client API call (apart from login and password reset), the client must be signed into PlayFab, but you can do that with zero-friction sign-in calls using Device ID or a locally generated GUID (Custom ID). Each unique player must sign into a distinct account, but by using logins that can cross devices (like Facebook, Twitch, Google, etc.), you can consistently sign the player into the same account from any device.

2. For leaderboards, you can get all the profile data for users, along with their scores. I'd recommend these tutorials: https://api.playfab.com/docs/tutorials#landing-tournaments.

3. Player data (arbitrary strings) is distinct from player statistics (numeric). For data, I'd recommend this tutorial: https://api.playfab.com/docs/tutorials/landing-players/using-player-data.

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.