'Unity Steamworks "InvalidOperationException: Steamworks is not initialized." after returning to offline scene in Mirror

So I just managed to integrate Unity Mirror with FizzySteamworks as transportation layer. My networkmanager is initialized in the offline scene (a main menu) and once I click "Play Game" everything works correctly until I quit (which I do by calling the method networkManager.StopHost()). This moves me to the offline scene, but whenever I press play again I get the following error: InvalidOperationException: Steamworks is not initialized.

The error

My NetworkManager settings

Is it possible that I disconnect/quit the game in a wrongful way? Should I disconnect via steamworks (Fizzy) instead?

Why is the SteamWorks API initialized only the first time when I enter the Main Menu and not the second?



Solution 1:[1]

You shouldn't destroy your Steam API's manager. Steam API must be initialized before you try to use it. You can set the manager to "do not destroy on load". The only way Steam API is destroyed is only when the whole game closes, not just changing scenes. In short it should be initialized once you game starts and set as do not destroy on load.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tamer Nasser