Connect Fish-Networking
The Fish-Networking transport supports Unity 2022.3 or later. Install Fish-Networking in the project before configuring the relay transport.
-
Install the transport
In Unity, open Window → Package Manager, choose Install package from git URL, and enter:
https://github.com/abdelfattahradwan/blitz-relay-for-fishnet.git?path=/Packages/com.winterboltgames.blitzrelay -
Assign the transport
On the GameObject containing the Fish-Networking
NetworkManager:- Add a
TransportManagerif one is not already present. - Add
BlitzRelayTransport. - Assign
BlitzRelayTransportto theTransportManagertransport field. - Set Relay Address, Relay Port, and Relay Key to match the running relay.
- Leave Room Code empty on a server that will create an ephemeral room.
- Add a
-
Start a host
Starting both the Fish-Networking server and client creates a local host. The transport waits for its server relay connection before starting the local client connection.
using BlitzRelay.FishNet;using FishNet;using UnityEngine;public sealed class RelaySession : MonoBehaviour{[SerializeField] private BlitzRelayTransport transport;public void StartHost(){transport.SetRelayAddress("relay.example.com");transport.SetRelayPort(7770);transport.SetMaximumClients(8);InstanceFinder.ServerManager.StartConnection();InstanceFinder.ClientManager.StartConnection();}}Configure Relay Key in the Inspector. The transport exposes runtime setters for the address and port, but not for the key.
-
Join the room
Set the room code before starting the Fish-Networking client:
public void Join(string roomCode){transport.SetRelayAddress("relay.example.com");transport.SetRelayPort(7770);transport.SetRoomCode(roomCode);InstanceFinder.ClientManager.StartConnection();}
Delivery channels
Section titled “Delivery channels”Fish-Networking channel 0 is relayed reliably. Channel 1 is relayed unreliably. Unsupported channel IDs are replaced with channel 0 and produce a warning.
Next steps
Section titled “Next steps”- Learn when to use ephemeral or persistent rooms.
- Understand the transport’s automatic host migration.
- See the full Fish-Networking transport reference.