Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

OnClientConnect and OnServerAddPlayer not triggering

Discussion in '5.2 Beta' started by sharat, Sep 1, 2015.

  1. sharat

    sharat

    Joined:
    Jun 24, 2011
    Posts:
    3
    The client NetworkManager gets OnStartClient() but doesn't seem to ever get OnClientConnect(). The server is getting the OnServerConnect() response before that but never gets OnServerAddPlayer() after calling either ClientScene.Ready(client.connection) or ClientScene.AddPlayer(client.connection, (short)0). These functions all seem to work fine when I'm running off of a single host with the second player added to the host client. Also of note, I'm getting a log about OnClientConnectInternal when I turn up the logs to developer mode, but still no call to OnClientConnect().

    I've been porting some networking code from Unity 4 and went up to 5.2 for the ClientAuthority features. I had basic stuff working in 5.1, but at some point I stopped receiving Client ready messages on the server. I've removed all special logic in my network manager and am just using the base version with extra logs statements and some (unused) keyboard shortcuts for running off of a single machine. Any help will be greatly appreciated!