Unlocking Achievements Directly

Directly unlocking achievements can be useful when you want to reward the user for something they discovered or did, such as a super difficult maneuver, passing a level without losing a life or eliminating more than 50 enemies in the same round or find a rare item. It's up to the developer to think of creative ways to create achievements to encourage and reward players, increasing the time they spend playing the game.

Use the code below to unlock an achievement directly:

[SerializeField]
SteamAchievements steamAchievements;

steamAchievements.UnlockAchievement("ACH_FIRST_STEPS");

You can also unlock an achievement in the Unity Editor by associating the SteamAchievements script with any event, as shown in the following example:

Achievement being unlocked on a button click event

Note that ACH_FIRST_STEPS corresponds to the Steamworks Achievement ID:

Achievement configuration in Steamworks

Important: to learn more about Achievements, as well as how to enable and configure it, please refer to the official documentation.

Last updated