Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Local wifi/bluetooth?

Discussion in 'Multiplayer' started by Architekt, Jul 30, 2014.

  1. Architekt

    Architekt

    Joined:
    Jul 6, 2014
    Posts:
    7
    I'm going to need to make a relatively simple game that can be played over local wifi/bluetooth on iOS and Android (no, iOS and Android wouldn't be communicating with each other). There would be up to say 4 players sitting near by. Can I do local wifi/bluetooth with Unity? And if so, where would be a good place to start learning how to do it? I'd prefer to stick with the native Unity solution to the problem rather than having to resort to buying/using a 3rd party. Thanks!
     
  2. Freezy

    Freezy

    Joined:
    Jul 15, 2012
    Posts:
    234
    to do local only networking, you would first have to discover the IP's in the local network, test each one for a specific port and await a valid reply (from your own local multiplayer hosts)

    Unity is used to having a master server which hosts lobby's to connect, so that a direct IP address is not needed and the port can be opened in case of any firewalls. This method relies on fixed IP for the server, making it easier to connect.

    You could always find a way to do your own UDP broadcast & receiver, which is probably the easiest way to find local network hosts and advertising your existance on the local network to potential clients. From there you can use the Unity networking to connect and play.
     
  3. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    963