steamworks.setAchievementUnlocked()

Type Function
Return value Boolean
Revision Release 2024.3703
Keywords steam, steamworks, achievements, setAchievementUnlocked
See also steamworks.setAchievementProgress()
steamworks.setNotificationPosition()
achievementInfoUpdate
steamworks.*

Overview

Unlocks the specified achievement for the current user. Unlocking an achievement will trigger a Steam notification popup.

Returns true if the achievement was successfully unlocked or was already unlocked.

Returns false if given invalid arguments or if the steamworks.isLoggedOn property is false.

Note

You can control where Steam’s notification popup will appear within the app by using the steamworks.setNotificationPosition() function.

Syntax

steamworks.setAchievementUnlocked( achievementName )
achievementName (required)

String. On the Steamworks website, this is the unique name of the achievement set under the API Name Progress Stat column.

Example

local steamworks = require( "plugin.steamworks" )

steamworks.setAchievementUnlocked( "My Achievement Name" )