Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Can't join a game as client from build. It only works when I'm in editor

Discussion in 'Multiplayer' started by mauri_galvez, Apr 20, 2017.

  1. mauri_galvez


    Dec 9, 2016
    Hi! I have been following the tanks multiplayer project as template to code a multiplayer game. However just recently I started getting a weird error. This happens whenever I try to join a game from a build :

    NullReferenceException: Object reference not set to an instance of an object
    at Logic.Networking.NetworkPlayerManager.Initialize (Logic.Networking.NetworkPlayer player) [0x00000] in <filename unknown>:0
    at Logic.Networking.NetworkPlayerManager.Initialize () [0x00000] in <filename unknown>:0
    at Logic.Networking.NetworkPlayerManager.OnPlayerIdChanged (Int32 playerId) [0x00000] in <filename unknown>:0
    at Logic.Networking.NetworkPlayerManager.OnDeserialize (UnityEngine.Networking.NetworkReader reader, Boolean initialState) [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.NetworkIdentity.OnUpdateVars (UnityEngine.Networking.NetworkReader reader, Boolean initialState) [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.ClientScene.OnUpdateVarsMessage (UnityEngine.Networking.NetworkMessage netMsg) [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.NetworkConnection.HandleReader (UnityEngine.Networking.NetworkReader reader, Int32 receivedSize, Int32 channelId) [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.NetworkConnection.HandleBytes (System.Byte[] buffer, Int32 receivedSize, Int32 channelId) [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.NetworkConnection.TransportRecieve (System.Byte[] bytes, Int32 numBytes, Int32 channelId) [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.NetworkClient.Update () [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.NetworkClient.UpdateClients () [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.NetworkIdentity.UNetStaticUpdate () [0x00000] in <filename unknown>:0

    The game in build stays in the lobby, but I can see the player entity in the game I joined in. Anyone has any suggestion on what this could be? I'm using unity 5.5.2f1