multiplayer-community-contributions icon indicating copy to clipboard operation
multiplayer-community-contributions copied to clipboard

Can't Install Netcode for GameObjects for WebGL even when planning to use Photon Realtime Transport on M1 Mac

Open tpitman opened this issue 2 years ago • 6 comments

I would like to create a multiplayer game using Netcode for GameObjects on WebGL.

I understand that the built in transports are not supported.

At the home page for netcode it says there are 3rd party transports that should work.

I am using Unity 2021.3 and tried to install the Netcode package version 1.0.2.

If I have the build settings targeted to WebGL I get the following error:

(0,0): error System.TypeLoadException: Could not load type 'Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle' from assembly 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

If I change it back to Windows, Mac, Linux the error goes away.

I am developing on a M1 MacBook Pro.

I also installed the Photon Realtime transport package from the git URL, but the error remains.

tpitman avatar Nov 05 '22 23:11 tpitman

To use WebSockets with Netcode for GameObjects it is quite a combination of specific versions and experimental packages. I created a thread about it here which you can follow. We are also working on further documentation and learning material on this topic.

chrispope avatar Nov 06 '22 09:11 chrispope

This is very appreciated.

I do have one question, however.

Is this using Photon Realtime or a Unity transport? It was my understanding that Photon Realtime will work directly because it relies on a server instead of a locally hosted server.

tpitman avatar Nov 07 '22 12:11 tpitman

I use Unity Transport, with no use of Photon. I am only running the editor and WebGL locally, WebGL client as a LocalClient and editor as LocalHost.

chrispope avatar Nov 07 '22 12:11 chrispope

I would like to use Photon actually. Do you happen to know about the error I mentioned specifically? Does it require all the steps you mention in order to use Photon as well or just to use the Unity Websockets transport?

tpitman avatar Nov 07 '22 12:11 tpitman

I don't know specifically, but I can suggest/clarify with you a few things.

  1. Are you trying with NGO 1.1 (which added Web Sockets support) and does the error still occur?
  2. What version of Collections package are you using in the project?

chrispope avatar Nov 07 '22 12:11 chrispope

I have not gone through your steps yet. I will be doing that later. I am sure I am probably using the release versions of everything.

I will try your steps later and report back whether it fixes the error or not. I was just wondering if that specific error meant anything to you.

tpitman avatar Nov 07 '22 12:11 tpitman