Description
I've got an issue where StopClient() always returns true when I try to call it with a random IP address with no server running on it (like 1 for example). The weird thing is, when I call StartClient() a second time, it returns false and says that it already has an instance running on it.
Reproduce Steps
This is the code used for replicating this issue:
using Unity.Netcode;
using UnityEngine;
public class TestStartClient : MonoBehaviour
{
void Update()
{
if (Input.GetKeyDown(KeyCode.A))
{
bool test = NetworkManager.Singleton.StartClient();
Debug.Log(test);
}
}
}
This code was attached to an empty in a new scene. There is also another empty with a NetworkManager and UnityTransport (see screenshot). Issue occurs when pressing a in play mode
Actual Outcome
StartClient returns true, even though its's not connected to a server. Apparently NetworkManager also thinks it is connected to a server.
Expected Outcome
I expected it to return false, since no actual connection is ever established. Also, I don't think StartClient() should log that there is already an instance running when calling StartClient() a second time (see screenshot)
Screenshots


Environment
- OS: Windows 10
- Unity Version: 2021.3.20f1
- Netcode Version: 1.2.0
- Netcode Commit: no idea sorry, the version is from December 09, 2022
Additional Context
I initially had this issue in another project where I used two UnityTransport components in one scene, since I wanted to be able to use Relay as well as Multiplayer over local network. I thought that might have been the issue, but apparently that was not the case, since I also had this issue in a completely empty project as you can see here.
I should also add that everything else works just fine with NetworkManager, I can start a host with no problem at all and also connect to it over local network using the correct IP address.
Description
I've got an issue where StopClient() always returns true when I try to call it with a random IP address with no server running on it (like 1 for example). The weird thing is, when I call StartClient() a second time, it returns false and says that it already has an instance running on it.
Reproduce Steps
This is the code used for replicating this issue:
This code was attached to an empty in a new scene. There is also another empty with a NetworkManager and UnityTransport (see screenshot). Issue occurs when pressing a in play mode
Actual Outcome
StartClient returns true, even though its's not connected to a server. Apparently NetworkManager also thinks it is connected to a server.
Expected Outcome
I expected it to return false, since no actual connection is ever established. Also, I don't think StartClient() should log that there is already an instance running when calling StartClient() a second time (see screenshot)
Screenshots
Environment
Additional Context
I initially had this issue in another project where I used two UnityTransport components in one scene, since I wanted to be able to use Relay as well as Multiplayer over local network. I thought that might have been the issue, but apparently that was not the case, since I also had this issue in a completely empty project as you can see here.
I should also add that everything else works just fine with NetworkManager, I can start a host with no problem at all and also connect to it over local network using the correct IP address.