Search Unity

Game Center Incremental Achievements

Discussion in 'Scripting' started by Horror, Nov 25, 2014.

  1. Horror

    Horror

    Joined:
    Jul 18, 2011
    Posts:
    207
    Hi there!

    I recently released my Android game and added an incremental achievement to it (kill 10,000 enemies). Google Play allows you to setup achievements that require a number of steps to complete and I was able to implement it in Unity very easily with this plugin. You just report the value to the server and the achievement accumulates automatically with each report.

    I'm now in the process of trying to accomplish the same thing in Apple's Game Center using the standard Unity Social API and I'm struggling with it. The main problem is that Game Center doesn't support incremental step achievements in the same way as Google Play. You can report a percent completion for any old achievement with Social.ReportProgress but it doesn't accumulate the value with each report - it just keeps the highest reported value.

    So I'm wondering how I handle incremental achievements on Game Center. Do I need to get the percentage of completion from the server, store it as a variable, add the local percentage of completion to said variable and then report the result back so that it stomps the previous percentage of completion on the server?

    I was looking at Social.LoadAchievements as a way of handling the above but I can't get my head around how it works. Can I use it to get the percentage of completion of a specific achievement ID and then store the value as a variable? I can't work out how to do it based on this documentation.

    Thanks, any help would be great :)

    EDIT:
    Worked out a solution here.
     
    Last edited: Nov 26, 2014
  2. sirswagon

    sirswagon

    Joined:
    Jun 11, 2019
    Posts:
    4
    got the same problem, no solution yet.
     
  3. Yiming075

    Yiming075

    Joined:
    Mar 24, 2017
    Posts:
    33
    got the same problem, no solution yet.