0

I was about to release a new game on Steam. It is a Unity game in which I use Steamworks.NET to get achievements from Steam.

I use the following code:

if (SteamManager.Initialized) {
    string name = SteamFriends.GetPersonaName ();
    Debug.Log (name+" - "+SteamUser.GetSteamID() );

    m_GameID = new CGameID (SteamUtils.GetAppID ());
    Debug.Log ("number of achievements: " + SteamUserStats.GetNumAchievements ());
    Debug.Log ("gameID: " + m_GameID);

} else {
    Debug.Log ("Steam not initialized");
}

m_GameID is set correctly (I use a steam_appid.txt file).

I use it for all my steam games, but for some reason SteamUserStats.GetNumAchievements () always returns 0.

I published the achievements on Steam, but still don't know why this is happening.

How I can correct that?

Shersh
  • 9,019
  • 3
  • 33
  • 61
fabiobh
  • 705
  • 2
  • 13
  • 33

1 Answers1

0

I discover the problem.

I just need to call SteamUserStats.RequestCurrentStats() in the update method. It's working now.

fabiobh
  • 705
  • 2
  • 13
  • 33