Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question Unity Steamworks Uninitialized error after returning to the offline scene with Mirror

Discussion in 'Multiplayer' started by LegoDude, Nov 18, 2022.

  1. LegoDude


    Nov 14, 2015
    To preface this, my problem is almost exactly the same as
    I have a game that utilizes Unity Mirror for multiplayer and FizzySteamworks as the transport. When I launch the game I can go through the game as expected until I wish to leave the lobby. When I try to press my leave lobby button, it calls Manager.StopHost() which then takes me to my offline scene. However, when I try and start a new lobby/game, I get the error: InvalidOperationException: Steamworks is not initialized.

    Now as I understand, because my NetworkManager is in my offline scene, when I switch back to the offline scene, something (SteamManager maybe or NetworkManager or something else, I haven't found what) destroys my old NetworkManager as to prevent having duplicates, which makes sense. The problem is that the new one/one from the offline scene is not the one I should be using/isn't being initialized causing the error.

    The fix described in the similar post does not work for me as Persist Network Manager To Offline Scene is no longer an option in the Mirror NetworkManager. I have tried finding where the old one is destroyed (No luck), as well as trying to reset/re-initialize steam in some way, also to no avail.

    Are there any recommendations on how I can either fix either destroying the old NetworkManager or fix the steam initialization failure? Thanks in advance.