Events
If you wish to call some other code when an achievement is unlocked or progress is made there are two events which can be bound. Both these functions return the key of an achievement (AchievementName).
** OnAchievementProgressUpdate, OnAchievementUnlock **
- Blueprint
- C++
void UMainGameInstance::Init()
{
Super::Init();
UAchievementSubSystem* AchievementSubSystem = GetSubsystem<UAchievementSubSystem>();
AchievementSubSystem->OnAchievementUnlock.AddDynamic(this, &UMainGameInstance::OnAchievementUnlock);
AchievementSubSystem->OnAchievementProgressUpdate.AddDynamic(this, &UMainGameInstance::OnAchievementProgressUpdate);
}
void UMainGameInstance::OnAchievementUnlock(FName AchievementName)
{
}
void UMainGameInstance::OnAchievementProgressUpdate(FName AchievementName, float NewProgress, float Change)
{
}