question

Eduardo Philipe Viana de Lima avatar image
Eduardo Philipe Viana de Lima asked

Change Leaderboard based on rule

Hi, how are you? So... to the point. Could someone show me an example of how to make Unity (or which playfab api to use) to move a player from one LeaderBoard to another when it reaches a certain position. In this case, example the player went from LeaderBoard 1 to 2, when I use the api GetLeaderboard it will show the current leaderBoard, correct. In this case, it won't show LeaderBoard 1 where he was, it will show LeaderBoard 2. Translated with www.DeepL.com/Translator (free version)

apisLeaderboards 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.

Gosen Gao avatar image Gosen Gao commented ·

One thing I don't understand, if you set the position to 100, does that mean you are moving the first 100 players to another leaderboard? If you do that, there will be another 100 players in the 1-100 ranking that will need to be transferred to another leaderboard, which is an endless loop. If you keep them in leaderboard 1 and update them to leaderboard 2, then leaderboard 2 will be a subset of leaderboard 1, which is unnecessary. Usually, we use score segments to differentiate leaderboards, not ranks.

0 Likes 0 ·
Eduardo Philipe Viana de Lima avatar image Eduardo Philipe Viana de Lima commented ·

Its the score, error on the machine translation.

0 Likes 0 ·

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

If you want to move a player from one LeaderBoard to another when it reaches a certain score. You can implement a Rule to trigger an Azure Function that will call API Update Player Statistics to update a new statistic value into LeaderBoard 2 and will set the statistic value of LeaderBoard 1 to 0. When you try to get leaderboard, you can call Player Data Management - Get Player Statistics first to get all statistics value on current player, and then load the Leaderboard that the value is exist and not 0.

5419-rule.png


rule.png (49.1 KiB)
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.