Hello,
I have a problem with Netcode for gameobjects.
When a client first joins a Server everything works fine, but if he leaves and tries to reconnect “NetworkManager.Singleton.ConnectedClientsIds.Count” will say there a 2 clients but the client wont be taken to the new scene as he normaly would, instead he stays in the main scene. I also get an error stating:
“MissingReferenceException: The object of type ‘NetworkObject’ has been destroyed but you are still trying to access it.”
but all the code executet befor is also in netcode so I dont think it is my code. I have attached a file with that error and everything that follows after that.
When I restart the host the client can join again.
This really confuses me as there isnt even a player prefab or anything i spawn. All Objects are spawned and owned by the host. I also attached a file with my NetworkManager settings.
When I get thrown to the main menu there would be 2 NetworkManager so I attached this script:
public void Awake()
{
if(instance == null)
instance = this;
else
{
Destroy(gameObject);
return;
}
DontDestroyOnLoad(gameObject);
}```
I use "NetworkManager.Singleton.Shutdown();" to close the previous connection.
This is really messing things up, if you have any idea it would be great. I am probably just blind to something obvious.
[8145998--1057856--DebugLog.txt|attachment](upload://pCCL1yeebStqwFXRNGcf55U3Q57.txt) (10.3 KB)
![8145998--1057859--Unbenannt.PNG|426x1198](upload://zEdirwh9GMhzwzEiaNyfAHICAzZ.png)