Unity-Technologies / multiplayer-community-contributions

Community contributions to Unity Multiplayer Networking products and services.
MIT License
421 stars 161 forks source link

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

Open tpitman opened 1 year ago

tpitman commented 1 year ago

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.

chrispope commented 1 year ago

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.

tpitman commented 1 year ago

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.

chrispope commented 1 year ago

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.

tpitman commented 1 year ago

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?

chrispope commented 1 year ago

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?
tpitman commented 1 year ago

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.