Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

NetworkLobbyManager is causing bugs whereas simple NetworkManager works fine

Discussion in 'Multiplayer' started by DBFace, Jan 4, 2017.

  1. DBFace


    May 22, 2016
    Hi everybody !
    I have a problem that broke my mind.
    I'm creating a very simple FPS multiplayer game to learn UNet.
    Everything works fine but I tried to implement the NetworkLobbyManager example.
    I test it. So, I create a lobby and run the game for 1 player : me.
    I have no error but the first Rpc Method is not working at all.
    What I don't understand, is that this method works fine with the simple NetworkManager.

    Here is my code

    Code (CSharp):
    1. void Start()
    2. {
    3.        if(isLocalPlayer)
    4.       {
    5.              Setup();
    6.       }
    7. }
    9. void Setup()
    10. {
    11.            CmdBroadCastNewPlayerSetup();
    12. }
    13. [Command]
    14. void CmdBroadCastNewPlayerSetup()
    15. {
    16.        RpcSetup();
    17. }
    18. [ClientRpc]
    19. void RpcSetup()
    20. {
    21.      Debug.Log("Start");
    22. }
    This code works with NetworkManager but not with the NetworkLobbyExample

    Edit : If I put a Debug.Log in the Command, it works even with the NetworkLobbyManager
  2. DBFace


    May 22, 2016
    Okay guys I have news.
    I tried to call my setup method by pressing a key and the Rpc method is working.
    I think that when the Start method is call, NetworkLobbyManager isn't ready to work with RPCs.
    I'm going to try to call that Setup method when the NetworkLobbyManager is ready