Search Unity

Can I retrieve the currently logged in players high score from leaderboard? [Unity + GPGS]

Discussion in 'General Discussion' started by adamvisionstudios, Feb 26, 2015.

  1. adamvisionstudios

    adamvisionstudios

    Joined:
    Apr 24, 2014
    Posts:
    44
    Hi everyone,

    I have looked around for the method with which to do this and have seen a variety of conflicting ideas and code.

    When posting a high score to a leaderboard with the Google Play Games Services plugin installed, it's actually very easy once set up;

    Code (CSharp):
    1. Social.ReportScore(CLIENTHIGHSCORE, "LEADERBOARD-ID", (bool success) => {    });
    This simply checks whatever my games 'CLIENTHIGHSCORE' against the users reported scores on the "LEADERBOARD-ID" leaderboard. If the local score is greater, then it replaces the score on the leaderboard. If not, nothing happens.

    Currently I save the CLIENTHIGHSCORE locally, and display it both at the end of a round, and in the options menu.

    I am just wondering if there is a reverse method for this type of function. So that if a user uninstalls, then reinstalls the product, the moment they sign into the game (and GPGS) it will query the Highest score for the user from the "LEADERBOARD-ID" leaderboard, and then replace the local "CLIENTHIGHSCORE" so that their high score moves with them across devices.

    I would really like to know if there is a simple method for doing this as implementing save states for just a high score seems kind of unnecessary, especially since I am still having trouble wrapping my head around cloud saving stuff.

    Any help would be greatly appreciated. Thanks a lot

    Adam Nickerson
    Game in question "Bing Bong"
     
    Last edited: Feb 26, 2015
  2. adamvisionstudios

    adamvisionstudios

    Joined:
    Apr 24, 2014
    Posts:
    44
    Also, if there is a better place to ask this question, please direct me there.

    Thanks
     
  3. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    tbh, I wouldnt bother.

    if they un-install it, they lose their score, it gets replaced when they submit a new highscore.
     
  4. adamvisionstudios

    adamvisionstudios

    Joined:
    Apr 24, 2014
    Posts:
    44
    Thanks for the feedback.

    I just thought it'd be neat so that if a person plays on say a tablet and a phone it would be the same high score.
     
  5. harrymomment

    harrymomment

    Joined:
    Jan 4, 2020
    Posts:
    2
    have you found any solution for this please ? i need the answer too