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’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

netcode for gameobjects dont connect to server (LAN)

Discussion in 'Netcode for GameObjects' started by ximik-xim, Jun 3, 2023.

  1. ximik-xim

    ximik-xim

    Joined:
    Jul 11, 2021
    Posts:
    1
    Hello everyone. I decided to try to create a server from a computer for tests. On the router, I set up a static (LAN) IP address at the computer and forwarded the ports. On the computer in the firewall, I gave permission to transfer data over the port and to enter and exit.
    I tried to implement a connection via netcode for gameobjects on the unity 2021 version.3.16f1. In NetworkManager, I used Unity Transport in Transport, it didn't work out through it (I indicated WAN IP) to connect 2 computers. Then I used UNet Transport and it turned out to connect 2 computers through it, but along the way there were errors that I could not fix.
    Install the Unity version 2022.3.0f1, there is no UNet Transport in it (because it is outdated), and I still can't connect 2 computers through Unity Transport. I can't find the reason why 2 computers can't connect through Unity Transport.
     
    SctBrly likes this.
  2. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    426
    Hi @ximik-xim, are the 2 computers in LAN or on different networks? If they're in LAN, you need to use their local IP to connect. If they're in different networks (= internet), you need to use a Relay server, dedicated server with public IP, or a NAT Punchthrough mechanism.