Search Unity

Unet Local Join

Discussion in 'UNet' started by SaphiBlue, Mar 5, 2017.

  1. SaphiBlue

    SaphiBlue

    Joined:
    Apr 18, 2016
    Posts:
    43
    Hello there,

    i have some Problem with my NetworkManager Script, I think.

    If I create a Local Server with (the class extends NetworkManager):

    Code (CSharp):
    1.     public void StartLocalHost()
    2.     {
    3.         Tools.UI.MenuHide();
    4.         Tools.gameName = "Local";
    5.         NetworkManager.singleton.onlineScene = "LocalTest";
    6.         NetworkManager.singleton.networkAddress = "localhost";
    7.         Tools.gameController.persistence.BasePath(NetworkManager.singleton.onlineScene);
    8.         NetworkManager.singleton.StartHost ();
    9.  
    10.     }
    the Local Server starts.

    but If i want to join the local Server

    Code (CSharp):
    1.     public void JoinHost()
    2.     {
    3.         NetworkManager.singleton.networkAddress = menuController.ui.joinHost.hostName.text;
    4.         StartClient();
    5.     }
    I join the Local Server, but the scene is not Changing to the servers Scene. So I only get a timeout message (on the server) if I close the Client Instance of the Game.

    Has somebody some experience with that problem?

    With the unity MatchMaker (internet) all works fine, but no local.
     
  2. SaphiBlue

    SaphiBlue

    Joined:
    Apr 18, 2016
    Posts:
    43
    I solved the Problem:

    In my Test setup, i stared the test Scene directly but in the build i uses the menu scene to join the server.

    This was not a good idea, because of the different scene indexes?