Search Unity

error There is already a player at that playerControllerId for this connections unity

Discussion in 'Multiplayer' started by ooza, Jan 8, 2017.

  1. ooza

    ooza

    Joined:
    Dec 12, 2016
    Posts:
    2
    Hi,
    When Online Scene in component Network Manager is not none Everything is fine.
    But When Online Scene in component Network Manager is none and i want change scene With code
    "NetworkManager.singleton.ServerChangeScene()"
    Was shown the following error:
    There is already a player at that playerControllerId for this connections

    Please Help Me.
     
    Kasiullinek likes this.
  2. onionman77

    onionman77

    Joined:
    Nov 3, 2013
    Posts:
    8
    Hi. I know this is late, but I was struggling with this issue for 2 weeks, and none of the other solutions were working for me. So in my case, this was happening when the client was ready to change to the next scene before the server was. It would want to spawn a player before the server was ready and that was what was causing this.

    So the way I solved it, was to disable auto-create player on the Client side, and have the server send a network message to the client to let it know it had succesfully changed scene and was ready to let it spawn it's player ( with ClientScene.AddPlayer(0) ).

    That answer was for anyone that found this through google and had that issue. Your specific problem. Online Scene should always be set. That's just the default first scene to load when you connect to or start a server. You can still change scenes with ChangeNetworkScene as normal after that.
     
    Last edited: Jul 4, 2018
    Kasiullinek likes this.
  3. billymonks

    billymonks

    Joined:
    Nov 19, 2016
    Posts:
    3
    @onionman77 I've been struggling with this same issue, but I'm having trouble sending a network message from the server to the client. Currently trying to write a message in OnServerSceneChanged, but having issues, either getting an error "Must call AddPlayer() with a connection the first time to become ready." or just nothing happening.

    Could you please provide some more details about your implementation? Your post is the only acknowledgement of this issue I've been able to find.