Search Unity

Question Text multiplayer with 2 phone issue

Discussion in 'Multiplayer' started by gamer123454321, Apr 2, 2021.

  1. gamer123454321

    gamer123454321

    Joined:
    Mar 25, 2020
    Posts:
    83
    Hi! I use mirror to try multiplayer game. There is no problem testing host/client within a pc. But when I install into my new and old Android phone to test it. They cannot connect. How to connect them?
    1.jpg
     
  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    'Connecting To Localhost'

    That's the problem, you need to be connecting to the IP address of the other device.
     
  3. gamer123454321

    gamer123454321

    Joined:
    Mar 25, 2020
    Posts:
    83
    I tried something like 192.168.72.114 has same result
     
  4. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    How did you come up with that IP address, did you get it from the device you want to connect to?
     
  5. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Are you connected to the same Network?
    The local host for your phone(which might be using the cell provider network) must be different from your computer(using whatever router you have)
    Try using the same network and then connect to localhost
     
  6. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    Localhost is the loopback connector for the same device the software is running on, if you want to make a connection to a different device on the same network you need to use that device's own IP address.

    If you're connecting to a device that's located on a different network, you need to know its WAN IP address and have port forwarding set up on the router for that network.

    Just guessing at IP addresses isn't going to work.
     
  7. gamer123454321

    gamer123454321

    Joined:
    Mar 25, 2020
    Posts:
    83
    I did it. Thank you so much
     
    Ruchir and Munchy2007 like this.