Skip to content

Connect Fish-Networking

The Fish-Networking transport supports Unity 2022.3 or later. Install Fish-Networking in the project before configuring the relay transport.

  1. 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
  2. Assign the transport

    On the GameObject containing the Fish-Networking NetworkManager:

    • Add a TransportManager if one is not already present.
    • Add BlitzRelayTransport.
    • Assign BlitzRelayTransport to the TransportManager transport 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.
  3. 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.

  4. 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();
    }

Fish-Networking channel 0 is relayed reliably. Channel 1 is relayed unreliably. Unsupported channel IDs are replaced with channel 0 and produce a warning.