Unity Netcode dependencies

Hi, I’m in deep with the Unity Netcode Multiplayer course. I wanted to implent those fine solutions to my project. Problem is…

Unity Netcode depends on Unity Transport, and it depends on Collections.
Unity Transport wants Collections in version 1.2.4.

Unfortunately I’m using very important package that depends, and installs, Collection in 2.1.4 version.

Unity Transport is not happy with it. :frowning:

For now I only have one kind of error in three places:

Library\PackageCache\com.unity.transport@1.4.0\Runtime\IPCManager.cs(107,47): error CS1955: Non-invocable member ‘NativeHashMap<ushort, int>.Count’ cannot be used like a method.

It is this bit IPCManager.cs of Unity Transport package.

Have you met with this kind of problem? How to tackle it?

Hi there,
My first thought is that you could use another Transport. There are some community supported transports that might work just as well as Unity Transport that might work for you here. There is a link to the repository in the Unity docs.

For the actual error, is that a script you are able to modify? Seems like those brackets after Count might just need to be deleted.

Unfortunately, another transports uses basic Tranport to override certain methods. Installing another transport gives you option to choose from dropdown list of the NetworkManager.

After I install Netcode for GameObjects - it won’t compile properly, becouse of the newer Collections I have installed. It won’t even let me create NetworkManager component.

After I make changes to the code in Collections - it changes immidiately back after compilation.

I think I’ve found solution.

Unity Transport 2.1.0 uses Collections 2.2.1.
https://docs.unity3d.com/Packages/com.unity.transport@2.1/changelog/CHANGELOG.html

In Unity Package Manager all I had for Unity Transport was 1.4.0.

To install Unity Transport 2.1.0 I had to use installation by name
https://docs.unity3d.com/Packages/com.unity.transport@2.1/manual/install.html

For now - no more problems with compilation. I will test it tomorow though.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms