API reference
API reference
Select your platform
No SDKs available
No versions available

ovr_Achievements_Unlock Function

Unlock the achievement with the given name. This can be of any achievement type: a simple unlock, count-based, or bitfield-based achievement. The Meta Quest Platform supports three types of achievements: simple, count and bitfield. Each achievement type has a different unlock mechanism. Simple achievements are all-or-nothing. They are unlocked by a single event or objective completion. For example, a simple achievement is unlocked when Frodo reaches Mount Doom. Count achievements are unlocked when a counter reaches a defined target. Define the ovr_AchievementDefinition_GetTarget() to reach that triggers the achievement. For example, a target achievement is unlocked when Darth Vader chokes 3 disappointing Imperial officers. Bitfield achievements are unlocked when a target number of bits in a bitfield are set. Define the ovr_AchievementDefinition_GetTarget() and ovr_AchievementDefinition_GetBitfieldLength() that triggers the achievement. For example, a bitfield achievement is unlocked when Harry destroys 5 of the 7 Horcruxes. ovrMessage_Achievements_Unlock will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrAchievementUpdateHandle. Extract the payload from the message handle with ovr_Message_GetAchievementUpdate().

Signature

ovrRequest ovr_Achievements_Unlock(const char *name)

Parameters

name: const char * The api_name of the achievement that will be unlocked, which can be retrieved by ovr_AchievementDefinition_GetName().

Returns