Search code examples
c#unity-game-enginesteamsteamworks-api

SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information. | Steamworks.NET


[Steamworks.Net] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.

It works fine in the Unity editor, but somehow I get an error with something built for Windows. The code is below. Very simple.

    if (SteamManager.Initialized)
    {
        string playerName = SteamFriends.GetPersonaName();
        Debug.Log(playerName);
    }
    else
    {
        Application.Quit();
    }

My username appears in debug in the editor. However, the build closes the app.

My app has not been published yet and I have not submitted any builds. But, the fact that the editor can identify the user maybe means that something went wrong during the build process.

I created a steam_appid.txt at the root of the project and entered the AppID.

What's the difference between playing in the editor and playing a build?

Someone teach me please. Thank you. (Google Translated)


Solution

  • I don't know why, but when I submitted the build to Steamworks and installed it on Steam, I got no errors.

    But uploading a build every time is very tedious...