➕
NetcodePlus
  • Getting Started
    • Netcode Plus
    • Asset Installation
    • Testing Locally
    • Network Types
    • Lobby and Matchmaking
    • Cloud Server Installation
    • Unity Services Server
  • Concepts
    • Managers and Important Scripts
    • Connection Process
  • Scripting
    • SNetworkObject
    • SNetworkBehaviour
    • SNetworkActions
    • SNetworkVariable
    • Network Messages
  • Other
    • Support and Community
Powered by GitBook
On this page
  • Link Project to Unity Services
  • Change Settings in your Project
  1. Getting Started

Unity Services Server

Last updated 11 months ago

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.

Link Project to Unity Services

Link Unity Project

First you need to link your project to Unity Services inside Project Settings-Services

Enable Relay

Go on the Unity Dashboard Make sure you select the project you linked to. And enable Lobby and Relay in the Multiplayer tab.

Change Settings in your Project

Change NetworkData in Resources/NetworkData Change lobby_type to Unity Services, and change lobby_game_type to RelayServer. Change auth_type to Unity.

Use auth_auto_logout when testing 2 instances on the same pc so that it doesn't use the same UserID twice. (Because it would prevent you from connecting to the same game).

Open the network manager prefab, and under UnityTransport, change the Protocol to Relay

Now you should be able to test from the LobbyMenu 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.

https://dashboard.unity3d.com/