Search Unity

Unity Mirror's Network Discovery is working for Android1 as host and Android2 as client but not the

Discussion in 'UNet' started by shubhamjindal27, Nov 15, 2021.

  1. shubhamjindal27

    shubhamjindal27

    Joined:
    Aug 29, 2019
    Posts:
    2
    I have implemented Mirror's network discovery in my sample unity project and did an android build on my two android devices.

    Scenario 1: I started wifi hotspot on Android1 and made Android2 connect using wifi. Now when i make Android1 as host in NetworkDiscoveryHUD and click "Find Servers" on Android2, it immediately displays Android1's IPAddress as available servers and i can also connect to it. But if i start host on Android2 and do "Find Servers" on Android1, with same wifi connection, no servers are found.

    Scenario 2: now if swap the wifi connection, meaning hotspot on Android2 and connect Android1 to it, the reverse happens. Means Android2 as host and Android1 as client working but not the other way round.

    To summarize, only the Android which creates hotspot can be the host and not client. But this is not the desired behaviour. i want any android can be host and others join to it without depending on which device create hotspot.

    But if i manually enter the ip address of the other host device in NetworkManagerHUD, the connection establishes not depending on which device creates the hotspot. So there is something in Network Discovery component that's not working.

    Please Help!! I want discovery component to work in both directions.
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    There's an open pull request on our github with an android fix.
    Try and let us know if it works.
    I don't have an android phone to test atm.