Unity 6 Multiplayer Relay WebSocket "wss" ERROR


I’m developing a webgl game, using Unity 6 Multiplayer, im setting the connection type to “wss” but still getting this error.

image (61)

Could you post the code that actually applies the “wss” as the connection type? The code you posted only uses the connection type in conditionals but it isn’t setting the connection type, neither for Relay nor for Transport.

@CodeSmile
I removed the Multiplayer and all related components, then re-imported Relay, Lobby, and other required packages one by one. After doing this, I was finally able to use the RelayServerData class as shown in the code snippets.

This was impossible while using the Unity 6 Multiplayer Package RelayServerData class includes the #IF directive shown in the screenshot.
Because if you download Unity 6 Multiplayer Package you dont have to download Relay SDK and RELAY_SDK_INSTALLED will be always false…

RelayServerData relayServerData = new RelayServerData(allocation, "wss");
            NetworkManager.Singleton.GetComponent<UnityTransport>().SetRelayServerData(relayServerData);

2 Likes

The problem with Unity 6 Multiplayer package
i found this solution using Unity Docs after Migrating from Relay to Multiplayer, if it helps for anyone

1 Like