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.

Resolved Using NetworkManager as client, having issues reconnecting.

Discussion in 'Netcode for GameObjects' started by CptanPanic, Mar 16, 2023.

  1. CptanPanic

    CptanPanic

    Joined:
    Dec 19, 2022
    Posts:
    15
    I am able to connect to server using NetworkManager.Singleton.StartClient(), And then receiving data using callback stated by RegisterNamedMessageHandler(). Which all works, but can't figure out how to reconnect if server drops. I can't startClient again, because it says there is already a client running, if I try to start client in OnClientDisconnectCallback . So what is best way to restart client?
     
  2. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    143
  3. CptanPanic

    CptanPanic

    Joined:
    Dec 19, 2022
    Posts:
    15