Search Unity

Using the Unity Network Lobby Example for local multiplayer

Discussion in 'Multiplayer' started by mike175, Jan 13, 2019.

  1. mike175

    mike175

    Joined:
    Jul 2, 2017
    Posts:
    5
    I'm trying to make a local multiplayer game for Android, where one player is a host and clients on the same network connect to the host using the Unity Network Lobby from the Asset Store.

    The game works fine when running several times on the same computer (as localhost), but when testing on multiple Android devices, it just doesn't connect. I know I need to put in the IP address of the host which hasn't worked, and I can't find any tutorials on this which solve my issue.

    Is there an easier/better way to do local multiplayer, maybe without the Unity Network Lobby asset? Or am I just doing something wrong?
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    The network lobby asset is full of bugs and it's very complicated (3k LOC?).
    I recommend inheriting from NetworkManager to make your own simple lobby. Store new connections in a lobby list until they picked a team, then start the game.
     
  3. mike175

    mike175

    Joined:
    Jul 2, 2017
    Posts:
    5
    Do you know of any tutorials or examples that I could use for this?
     
  4. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    As far as I know, the only working lobby example for UNET/Mirror is in my uMOBA asset.
    Maybe use Unity's NetworkLobby asset and try to simplify it where possible. Should be good learning experience.
     
  5. RR7

    RR7

    Joined:
    Jan 9, 2017
    Posts:
    254
    assuming the host IP is on the LAN, and the fact they run on the same computer and not talk to each other might just be a simple local firewall issue on the clients?
     
  6. mike175

    mike175

    Joined:
    Jul 2, 2017
    Posts:
    5
    The host IP is on the LAN, yes, but when running on the same computer, it works fine. It is only when running on separate Android phones that it does not work.