> For the complete documentation index, see [llms.txt](https://docs.luckyraccoongames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luckyraccoongames.com/really-simple-steam-integration/stats-and-achievements/unlocking-achievements-from-stats.md).

# Unlocking Achievements from Stats

There are achievements that require the player to do some action a certain number of times to be unlocked, for example: kill 100 enemies, jump 50 times, collect 1000 coins, etc. Fortunately, Steam has a stats system that helps track the player's progress and even unlocks achievements automatically when a certain number (defined by you) is reached. For this to work, you must interact with a stat rather than directly interacting with the achievement.

Use the code below to increment a stat:

```csharp
[SerializeField]
SteamAchievements steamAchievements;

steamAchievements.IncrementStat("STAT_JUMP");
```

You can also increment a stat in the Unity Editor by associating the SteamAchievements script with any event, as shown in the following example:

<figure><img src="https://365534536-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe3sbbo5VF7BduV4kMEFP%2Fuploads%2FD18YcJrMuCypdFBQZJJm%2Fimage.png?alt=media&amp;token=fa0d3d5e-a5e1-47d0-8ecd-63edf60d556a" alt=""><figcaption><p>A stat being incremented on a button click event</p></figcaption></figure>

Note that STAT\_JUMP corresponds to the Steamworks Stat ID:

<figure><img src="https://365534536-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe3sbbo5VF7BduV4kMEFP%2Fuploads%2FySPcPUzJ0AsR2yZGAI0O%2Fimage.png?alt=media&amp;token=1f4aeb1e-4ef6-4ddd-9113-b89890b9c530" alt=""><figcaption><p>Stat configuration in Steamworks</p></figcaption></figure>

When increasing a stat, if the amount required to unlock the achievement is reached, the achievement will be unlocked automatically.

{% hint style="info" %}
**Important:** to learn more about Stats, as well as how to enable and configure it, please refer to the [official documentation](https://partner.steamgames.com/doc/features/achievements/stats_guide).
{% endhint %}
