Connect Netcode for GameObjects
The NGO transport supports Unity 6000.0 or later and Netcode for GameObjects 2.13.0.
-
Install the transport
In Unity, open Window → Package Management → Package Manager, choose Install package from git URL, and enter:
https://github.com/abdelfattahradwan/blitz-relay-for-ngo.git?path=/Packages/com.winterboltgames.blitzrelayforngoNetcode for GameObjects 2.13.0 is declared as a package dependency.
-
Assign the transport
On the GameObject containing
NetworkManager:- Add
BlitzRelayTransport. - Assign it to Network Manager → Network Config → Network Transport.
- Set Relay Address, Relay Port, and Relay Key to match the running relay.
- Leave Room Code empty on the player who will create an ephemeral room.
- Add
-
Start a host
Call
NetworkManager.StartHost()for a listen-server host, orStartServer()for a server without a local NGO client.using BlitzRelay.Ngo;using Unity.Netcode;using UnityEngine;public sealed class RelaySession : MonoBehaviour{[SerializeField] private NetworkManager networkManager;[SerializeField] private BlitzRelayTransport transport;public void StartHost(){transport.SetRelayAddress("relay.example.com");transport.SetRelayPort(7770);transport.SetRelayKey("your-connection-key");transport.SetMaximumClients(8);networkManager.StartHost();}}The relay assigns the room code asynchronously. Read
transport.GetRoomCode()after the server transport has connected; share that value with joining players. -
Join the room
Set the room code before starting the NGO client:
public void Join(string roomCode){transport.SetRelayAddress("relay.example.com");transport.SetRelayPort(7770);transport.SetRelayKey("your-connection-key");transport.SetRoomCode(roomCode);networkManager.StartClient();}
Delivery modes
Section titled “Delivery modes”NetworkDelivery.Unreliable and NetworkDelivery.UnreliableSequenced use the relay’s unreliable channel. Every other NGO delivery mode is carried over reliable ordered relay delivery.
Next steps
Section titled “Next steps”- Learn when to use ephemeral or persistent rooms.
- Implement host migration.
- See every field, method, and event in the NGO transport reference.