Search Unity

Help with LAN multiplayer

Discussion in 'Multiplayer' started by Bigbeef, Jan 23, 2017.

  1. Bigbeef

    Bigbeef

    Joined:
    Apr 6, 2013
    Posts:
    31
    I am trying to get 2 different computers to talk to each other in my multiplayer unity project. All the unity tutorials I've come across show you how to set up either localhost multiplayer (2 exe's on the same computer) or using UNET with an internet connection to set up a non-local server.

    Is there a way to simply send and receive data over a wireless router that isn't hooked up to an internet connection? I've tried changing the IP address the client is connecting to, but not sure what the right way to go about this is.

    Any direction would be appreciated.
     
  2. Xuzon

    Xuzon

    Joined:
    Mar 21, 2014
    Posts:
    83
  3. Bigbeef

    Bigbeef

    Joined:
    Apr 6, 2013
    Posts:
    31
    Thank you for your quick response. I disabled my router's firewall and then utilized the the Network Discovery component you suggested and it is working in some way. I click server broadcast, and then on the other PC I click the listen button and another button pops up stating "Game at: 192.168.1.100"

    How am I to proceed from here? What is supposed to happen when I click that button? is it supposed to connect to that game or something? Am I still supposed to use the network manager in tandem with this Network Discovery to connect and send/receive data updates?

    It's working, but I just don't understand how this all ties together.

    Thanks again!
     
  4. Xuzon

    Xuzon

    Joined:
    Mar 21, 2014
    Posts:
    83
    Yeap, you have to use the network manager also.

    When you click that button it means that the network manager will try to connect to a game on that IP so if the server's firewall is disabled (I hope there is a way without disabling firewall) the server accept the connection and then the client would connect to the server