uNet- A connection has already been set as ready. There can only be one.

I get this error when I try hosting a server using uNet’s NetworkManager:

A connection has already been set as ready. There can only be one.
UnityEngine.Networking.NetworkManager:Update()

And I am not sure why. All I do is call StartHost() and then later call ClientScene.AddPlayer(0) to spawn a player.

Any idea why this happens?

Hi.
Think I figured out where is ClientScene.Ready() or ClientScene.AddPlayer(0) called second time.

It’s OnClientSceneChanged() method. Here is documentation, read the last sentence.

You can just override method and call in it your own code without calling base method.

I had this error when I extended NetworkManager. By trying to comment out various sections, I ended up finding what was causing it. Although I don’t remember exactly what it was, I suppose this method would work for you, too.

For me it was the fact that a Lobby Player’s

SendReadyToBeginMessage();

triggers the Lobby Manager’s

CheckReadyToBegin();

and if all Lobby Player flags (readyToBegin) are true, it tries to start the game.

If you call this more than once before the game starts, it will fail produce the following error:

A connection has already been set as ready. There can only be one.
 UnityEngine.Networking.NetworkManager:Update()