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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Unity Multiplayer Is there a way to join player in other network without lan connection with him?

Discussion in 'Multiplayer' started by Xyloven, Aug 14, 2022.

  1. Xyloven

    Xyloven

    Joined:
    Feb 22, 2021
    Posts:
    6
    If i can, then how to do it?
     
  2. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    AFAIK LAN connection doesnt work with different networks.

    If you want to connect with someone on other network you can:

    -Port forward: Open a port on you router so it doesnt block connections on that port.
    -Host a dedicated server on Azure, AWS, Google Cloud… and both players connect to that server.
    -Use a relay like Steam, Photon, Epic or Unity.
     
  3. Xyloven

    Xyloven

    Joined:
    Feb 22, 2021
    Posts:
    6
    what do you mean by "unity"?
     
  4. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Unity relay
     
  5. Xyloven

    Xyloven

    Joined:
    Feb 22, 2021
    Posts:
    6
    Is there a free way to do non-lan connection?
     
  6. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Port forwarding is completely free

    Hosting a server can be free (with limits):
    -With Azure and AWS you have some free hours every month (depending on the region and how much cores the server has)
    -Google cloud offers a free cluster

    About relays:
    -Steam costs a one time fee (100$) which includes launching your game on steam. But you can use app id 480, which is a free app id for developers to test (if you use this keep in mind that there are a lot more devs doing it, and your lobbies can appear on their lobby list and vice versa)
    -Photon Realtime has 20 free CCU, and you have to pay as you get more.
    -EOS is free, but a nightmare to use.
    -I dont know about Unity Relay, but I think its free until you get X number of CCU.

    This relays can be considered too low level (I dont know about unity) and a little bit hard to use, so there are some transports for networking solutions that act like wrappers for them:
    -Mirror has a Steam and Epic transport.
    -Photon PUN, bolt and fusion are built on top of realtime.
    -Fish-Net has a Steam transport and a Epic transport will come soon, and I think that a Photon realtime transport is planned.
    -Netcode for gameobjects has a Steam transport and a Photon realtime transport.
    -Riptide has a Steam transport.
     
  7. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    I think it uses Photon PUN, but it will be a better idea to use fusion.