Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

uNet can't connect android devices

Discussion in 'UNet' started by DripSta, Oct 3, 2020.

  1. DripSta

    DripSta

    Joined:
    Apr 20, 2020
    Posts:
    56
    I have made an android game that I need to connect via muliplayer and I'm using uNet for that. (Unity 2018)
    When I build the game for pc, I can connect pc to pc but Android to Android devices don't connect to one another. Like for the pc, I would press on the LanHost button and on the other pc, I would press the Lan Client button and they would connect. But on an android device, when I press the Lan Host button, the player stays in the lobby and isn't ushered into the game play scene and when I press Lan Client, the same happens, it just stays in the Lobby and because of this, I can't connect using local Wifi.
    The android device also don't connect to the pc or to each other
    I and using the Samsung Galaxy S9 plus and the Huawei P8 lite as my connection devices
    May someone please offer me some help with this
    Thanks in advance
     
  2. nesohiy143

    nesohiy143

    Joined:
    Oct 16, 2020
    Posts:
    1
    login to your router using the ip address 192.168.0.1 and see if your device is blocked in access control !
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Unet is buggy and basically abandoned at this point. If you're using network discovery instead of direct IP address, there are known issues with some mobile devices which were never resolved. In past threads I think is was narrowed down to software firewall behavior on the devices, but the threads are from several years ago so I don't know if I am remembering correctly. I'd switch to another networking solution so you don't waste too much time on this. Good luck
     
    DripSta likes this.
  4. DripSta

    DripSta

    Joined:
    Apr 20, 2020
    Posts:
    56
    I'm trying to connect the android devices locally and not via an internet match.
     
  5. DripSta

    DripSta

    Joined:
    Apr 20, 2020
    Posts:
    56
    Oh and I heard about Mirror as a good alternative, but I'd just like to know whether it's capable of accomplishing the same tasks that uNet can accomplish because I heard that you need to host your own servers and uNet already has servers ready for you, so does that limit Mirror in its Capabilities?
     
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I haven't used Mirror, but you already said this was a LAN game instead of over the Internet, so not having access to the deprecated Unity Multiplayer Service servers shouldn't be an issue. If you're using Network Discovery, I see from the Mirror docs that it is still there. I have no idea if they have gotten around the previous Unet issues on some mobile devices.

    https://mirror-networking.com/docs/Articles/Components/NetworkDiscovery.html
     
    DripSta likes this.
  7. DripSta

    DripSta

    Joined:
    Apr 20, 2020
    Posts:
    56
    Sorry for the late response, I've been busy with exams
    Thank you so much for the info on Mirror and it's Network Discovery, I'll definitely look into using Mirror once I get time and I'll keep you updated;)
     
    Joe-Censored likes this.