diff --git a/Assets/Mirror/Core/NetworkManager.cs b/Assets/Mirror/Core/NetworkManager.cs index 22ae8cff1..746985dbe 100644 --- a/Assets/Mirror/Core/NetworkManager.cs +++ b/Assets/Mirror/Core/NetworkManager.cs @@ -404,6 +404,12 @@ public void StartClient() return; } + if (string.IsNullOrWhiteSpace(networkAddress)) + { + Debug.LogError("Must set the Network Address field in the manager"); + return; + } + mode = NetworkManagerMode.ClientOnly; SetupClient(); @@ -413,13 +419,6 @@ public void StartClient() RegisterClientMessages(); - if (string.IsNullOrWhiteSpace(networkAddress)) - { - Debug.LogError("Must set the Network Address field in the manager"); - return; - } - // Debug.Log($"NetworkManager StartClient address:{networkAddress}"); - NetworkClient.Connect(networkAddress); OnStartClient();