Achievements
Use achievements to mark in-game milestones, such as defeating the first boss or collecting 100 coins.
Configuration
Declare your achievements once in the config. Each entry has a game-level id you use in code, optional name/description for your own UI, and per-platform blocks with the ids the platform dashboard expects:
{
"achievements": [
{
"id": "level_10",
"name": "Level 10",
"description": "Reach level 10",
"y8": { "achievement": "Level 10", "achievementkey": "abc123" },
"lagged": { "id": "lagged_achievement_id" }
}
]
}In code you always work with the flat game-level
id(level_10).The per-platform blocks are only needed for platforms with native achievements — the SDK maps the game-level id to them automatically.
On all other platforms the configured list drives the SDK-managed local tracking;
nameanddescriptionare returned as-is for your UI.
Unlock achievement
Unlock an achievement after the player meets its in-game condition. Send each achievement only once.
Call the Achievements Unlock action with the game-level achievement id, then handle the On Achievements Unlock Completed trigger.
Call the Achievements Unlock action with the game-level achievement id, then handle the On Achievements Unlock Completed condition.
Get achievements
Returns the full achievements list in a normalized, platform-agnostic shape with the player's unlocked state:
On native platforms the ids are mapped back to your game-level ids. On other platforms the SDK returns the configured list with the locally tracked unlocked flag (an empty array when nothing is configured).
Call the Achievements Get List action, then handle the On Achievements Get List Completed trigger. Read the result with the AchievementsCount and AchievementPropertyValue(achievementIndex, property) expressions (property is a field name like "id", "name", "description", "unlocked").
Call the Achievements Get List action, then handle the On Achievements Get List Completed condition. Read the result with the PlaygamaBridge::AchievementsCount() and PlaygamaBridge::AchievementPropertyValue(achievementIndex, property) expressions (property is a field name like "id", "name", "description", "unlocked").
Last updated