Search Unity

Hosting and connecting MLAPI over LAN

Discussion in 'Multiplayer' started by christian_unity770, Sep 10, 2021.

  1. christian_unity770

    christian_unity770

    Joined:
    Aug 28, 2018
    Posts:
    6
    Hello,

    we are trying to make our game work (host and connect) over LAN. I am hosting on my computer and another participant in the same LAN is trying to connect. However, it is not working and we cannot figure out why.

    Here are the Unity Settings for our UNetTransport in the NetworkManager:


    The IP address matches my LAN IP address:
    (the port is not being used by another application)



    Both of our windows firewalls are turned off.


    One thing that seems fishy, is that the logfile, when the application is started, shows another port being occupied than the one we entered in Unity:




    We are clueless how to proceed at this point and appreciate any help.

    Thank you very much! :)
     
  2. christian_unity770

    christian_unity770

    Joined:
    Aug 28, 2018
    Posts:
    6
    I might want to add that I can host and connect to my own PC when starting the application multiple times.
     
  3. qbvbsite

    qbvbsite

    Joined:
    Feb 19, 2013
    Posts:
    83
    you check your windows firewall setting to make sure its not blocking the connection?
     
  4. christian_unity770

    christian_unity770

    Joined:
    Aug 28, 2018
    Posts:
    6
    Thanks for your reply, but as I mentioned, our windows firewalls are completely disabled on both sides.
     
  5. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    The logs you are seeing using the 54997 port are from the Unity debugger and profiler and not from MLAPI.

    Have you tried pinging the other computer?
     
  6. christian_unity770

    christian_unity770

    Joined:
    Aug 28, 2018
    Posts:
    6

    The logs were from the built game - but your hint was extremely helpful! I realized that we still had the "development build" checked. After unchecking it, we can now connect.

    Thank you very much - would never have noticed that without your help! <3



    Lovely community :)
     
    luke-unity likes this.
  7. christian_unity770

    christian_unity770

    Joined:
    Aug 28, 2018
    Posts:
    6
    It should probably be mentioned in the documentation though that "development build" is not working on network. It is not super obvious, considering you might want to debug over the network too, IMO.

    (if it actually is in the docs, it is certainly not easy to find)
     
  8. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    I have used development builds with MLAPI in the past without issues. So I think you have a special situation here which might not apply to everyone.