Adding a matchmaking lobby
So far, connecting two or more players over the network requires you to know the IP address of the host instance of the game that is running, or simply localhost
if they're all running on the same machine.
Unity Networking and Cloud Services includes a built-in networking lobby manager for matchmaking between online players. It lets you create and join online "rooms," limited to a maximum number of players. Using the lobby feature is as easy as choosing Enable Match Maker
in the Network HUD in your app. But first, you must subscribe to Unity Multiplayer cloud services (free, with limits for the number of concurrent users, based on your Unity license).
To use it, first enable Unity Cloud Services for your app:
- Above
Inspector
, select theCloud icon
(indicated in the following screenshot) to open theServices
window - Create or choose a
Unity Project ID
for this project. To create an ID, clickSelect Organization
and choose your organization, and then clickCreate
. - Choose...