Achievements
Last updated
Last updated
The achievements data type lets you easily create unlockable achievements. Simply define the max score an achievement must reach to get unlocked. Use the following API to add points and listen to an unlocked event:
Create a new achievement data object.
Assign the total score and create a new OnAchievementUnlocked event.
Stats add-on comes with a dedicated StatsEvents type which contains either the unlcoked achievement, a new value or a new progression.
OPTIONAL: If you have installed the Logic add-on, you can also add a custom logic which gets called on achievement unlocked.
AddPoints(int _points);
The points are automatically added to the runtime data object of the achievement data object.
Listen to the StatsEvents OnAchievementUnlocked
Get the current score of the achievement
Get whether achievement is unlocked or not.