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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Connecting 2 pc's to one game

Discussion in 'Multiplayer' started by Willtree8, Feb 24, 2016.

  1. Willtree8

    Willtree8

    Joined:
    Apr 22, 2015
    Posts:
    9
    This has probably been answered a million times before but is confusing to a beginner. I have followed the unity documentation's network tutorial and as far as I can tell it does not say how to connect 2 pc's (laptop + desktop) to one server (hosted on desktop.) I am using the basic network manager + hud and have been able to set it up so one instance of the game can connect to another but only on the same pc. Basically, how do I connect one instance of the game on my laptop to the one on my desktop? Help please!
     
  2. Willtree8

    Willtree8

    Joined:
    Apr 22, 2015
    Posts:
    9
    Last edited: Feb 24, 2016
  3. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
  4. Willtree8

    Willtree8

    Joined:
    Apr 22, 2015
    Posts:
    9
  5. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
    Okay, so I guess you've read that article then.

    All you need is an external IP address from one computer, and the other computer start a LAN Host. When LAN Host is ready, enter the IP address in the textfield where "localhost" is, and press Start LAN Client for the other computer. You should immediately connect.

    If not, check your network settings, connections, and other things related.
     
    BusraAlkan likes this.
  6. Willtree8

    Willtree8

    Joined:
    Apr 22, 2015
    Posts:
    9
    It said in the dev console (on client): 'unet client disconnect error: timed out' ... soooo
     
    Last edited: Feb 24, 2016
  7. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
    Are you sure you put in your external IP address (Replacing "localhost" with something like 13.86.15.213)? If yes, then it is your router/modem connection issue, and not Unity's.
     
  8. Willtree8

    Willtree8

    Joined:
    Apr 22, 2015
    Posts:
    9
    i googled 'what's my external ip' is that right? Also if it is a router/modem issue how would I go about fixing it?
     
  9. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
    1. Yes. It should show you your external IP address.
    2. PortForward.com
     
  10. Willtree8

    Willtree8

    Joined:
    Apr 22, 2015
    Posts:
    9
    I know how to port forward but wasn't sure which ports to portforward, so i did both 7777 and 47777 (tcp and udp) but with no success.
     
  11. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
    I think 7777 is already used. May try a different port number.

    If that also doesn't work, then I really don't know.
     
  12. Willtree8

    Willtree8

    Joined:
    Apr 22, 2015
    Posts:
    9
    Ok, will try that when I get back to my pc, thanks for the help!
     
  13. BusraAlkan

    BusraAlkan

    Joined:
    Nov 21, 2017
    Posts:
    1