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.

Question Peer-to-peer help.

Discussion in 'Unity Transport' started by VentaGames, Mar 7, 2023.

  1. VentaGames

    VentaGames

    Joined:
    Jul 9, 2021
    Posts:
    64
    Hi there, i want to add to my game peer-to-peer mode over BT/WiFi.
    Googling has not helped much. Any advice, on what service to use and why?
    I've checked Unity's Relay service, it does a lot that i don't need, e.g. networking.
    I just want android/ios players can challenge each other and play sitting in the same room.
    Even, if i go with Relay, i'm not sure how that free 50 CCU/month are applied.
    I'm new to network games here, so, please forgive me i asked dumb questions,
    but i need some help.
    Thanks in advance.
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    231
    If you want multiple devices to connect to each other, you'll need some networking at least. ;)

    If it can help your search, what you're looking to achieve is local area networking. If you search for "LAN" you'll find more information about this. You can use a service like Unity Relay to achieve your goal, but if all your devices will be on the same local network, that's not really necessary. You will generally want one player to assume the role of game host, and have other players (clients) connect to it using the host's local IP address. If you don't want players to deal with details like IP addresses, there are solutions that allows clients to find the host automatically. This is normally called network discovery (here's an example implementation).