- Home /
Steamworks.NET - Trying to get achievement name
Hi, I'm trying to get Steam achievements to work in my game, but something is not right. I've already created an achievement, and I can see it from the Steam client (so it is published). And now, I'm trying to make something as simple, as getting its name, but I'm just getting an empty string.
I do this to get the achievement name:
achievementName = SteamUserStats.GetAchievementName(1);
And then print the "achievementName" after pressing a button. I'm not sure at the moment, if the argument for GetAchievementName should be 1 since the achievement has ID "2/0" on Steamworks, but it gives me an empty string for 2 and 0 all the same.
According to this, basic setting things up should be extremely simple, but it just doesn't do anything for me. Steam is being initialized, I can see my account name, apparently it does see my game too, because otherwise it wouldn't initialize. I'm running out of things to debug. Maybe I'm missing something really basic here? I keep wondering, the game and Steam page don't have to be finished to achievement testing?
Answer by glock18_unity · Jul 07, 2021 at 04:49 AM
I've just found, that the solution is to add SteamUserStats.RequestCurrentStats(); in Update(). I will definitely have to optimize it, but the bottom line is, that is what I was missing.
private void Update()
{
SteamUserStats.RequestCurrentStats();
}