Unity Services Server
Last updated
Last updated
Instead of using a dedicated game server, you can also use Unity Lobby + Unity Relay to connect your players, so that you don't need to host your own dedicated server, but they also don't need to change their firewall and router settings. This means the game server logic is executed by the host player instead or your own server, but the network messages are sent through a relay service to prevent firewall issues.
First you need to link your project to Unity Services inside Project Settings-Services
Go on the Unity Dashboard https://dashboard.unity3d.com/ Make sure you select the project you linked to. And enable Lobby and Relay in the Multiplayer tab.
Change NetworkData in Resources/NetworkData Change server_type to Unity Services.
Open the network manager prefab, and under UnityTransport, change the Protocol to Relay
Now you should be able to test from the Menu scene. It if you have issues connecting, it may be because of version mismatch between Unity Engine, Netcode package, Lobby package and Relay package. Try updating Netcode, Lobby and Relay packages to latest or recommended version in the Package Manager.