0
\$\begingroup\$

For example the achievement is "Pass 5 levels in a row without failing"

It's incremental and has five steps.

If a user hits an obstacle, this achievements score should obviously be resetted to 0.

How to to this? I found no such method or anything in the internet.

\$\endgroup\$
2
\$\begingroup\$

You don’t. This would need to be simply a single-step achievement.

\$\endgroup\$
3
  • \$\begingroup\$ So it's not even possible? \$\endgroup\$ – Squareoot Jan 17 '20 at 12:06
  • 1
    \$\begingroup\$ @Squareoot it's possible, but tracking the increments of "3/5 levels passed without failing" happens in your game code, not in Google's back-end. Since that variable lives in your code (or on your server if you need to persist it between game sessions, depending on how strictly you define "in a row"), you can reset it to zero anytime you want. Once the variable hits 5, only then do you report to Google "This single-step achievement is complete!" \$\endgroup\$ – DMGregory Jan 17 '20 at 12:52
  • \$\begingroup\$ @DMGregory thanks I understand. \$\endgroup\$ – Squareoot Jan 17 '20 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.