Sign In Register

How can we help you today?

Start a new topic
Answered

NewHighScoreMessage

Hi,

I have made a successful integration in my Unity game with GameSparks, however, i find the documentation limited:

The game currently posts new records to the leadderboards fine, however after posting a new score I want to know the new rank of the player. This comes from an asynchronous message NewHighScoreMessage, but I do not know how to retrieve this.

I guess the concrete question is, how to retrieve the new player rank after submitting his score to the leaderboard?


best regards


Best Answer

Hi Miguel,


You can achieve this in Cloud Code by accessing leaderboard entries for a player.


var entries = Spark.getLeaderboards().getLeaderboard(shortCode).getEntriesFromPlayer(playerId, count);


This will return a SparkLeaderboardCursor, over which you can iterate and locate a specific entry. These methods are explained in the documentation 
here


Thanks,

Liam


Answer

Hi Miguel,


You can achieve this in Cloud Code by accessing leaderboard entries for a player.


var entries = Spark.getLeaderboards().getLeaderboard(shortCode).getEntriesFromPlayer(playerId, count);


This will return a SparkLeaderboardCursor, over which you can iterate and locate a specific entry. These methods are explained in the documentation 
here


Thanks,

Liam

thanks I will try that tonight

Login to post a comment