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

Third Party How can i make an online lobby joinable by IP in Mirror

Discussion in 'Multiplayer' started by Antoner_8, Nov 10, 2023.

  1. Antoner_8

    Antoner_8

    Joined:
    Aug 23, 2022
    Posts:
    10
    Searching on the internet ive seen just LAN tutorials of mirror and i dont know if the is a way to connect to other device that is not with same network. I have tried changing networkadress, it works when creating but not when joining , networkadress is the same in the two devices, help pls.
     
  2. Gamemakers3D

    Gamemakers3D

    Joined:
    Dec 8, 2020
    Posts:
    24
    1. windows 10/11 pc firewall settings allow incomming Udp port i guess 7777 and if webgl Tcp Port, and connect from other devices using same router that shares dhcp names and local adresses at lan party
    2. by hosting server also posible through unity 3d editor as Tcp sockets (uncrypted) keep using adresses of lan router in example 192.168.0.101 , not localhost 127.0.0.1 <~~ instances are only monitor share !
    3. Tell us and community? 1 or 2 can help, can you now multiplay with other devices together using mirror in unity 3d, example tanks with lights
    4.optional - mlapi has next level ssl as alternative that ticks --missing-demo-tanks requests community for dev webrtc/sockets and generate crypt certificates to use it in chrome as udp. sry if bug on display type.
     
  3. Antoner_8

    Antoner_8

    Joined:
    Aug 23, 2022
    Posts:
    10
    ok, im using an ip like this example: 192.168.0.101 and when i try to join from other device, it just doesnt join, sorry im very beginner and i dont undertand too much.
     
  4. Antoner_8

    Antoner_8

    Joined:
    Aug 23, 2022
    Posts:
    10
    Create the game script:
    Code (CSharp):
    1.     public void StartGame()
    2.     {
    3.  
    4.         NetworkManager.singleton.networkAddress = GetLocalIPAddress();
    5.  
    6.         NetworkManager.singleton.StartHost();
    7.     }
    Join the game script:
    Code (CSharp):
    1.     public void JoinGame()
    2.     {
    3.         string ipAdress = inputTextJoin.text;
    4.  
    5.         NetworkManager.singleton.networkAddress = ipAdress;
    6.         NetworkManager.singleton.StartClient();
    7.     }