Unity-Technologies / multiplayer-community-contributions

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

Upgrade to Unity 2022 gives NativeList script error #230

Closed tpitman closed 6 months ago

tpitman commented 1 year ago

I have a project that was working fine in Unity 2021. I want to upgrade it to 2022.

When I do I get the following error:

Library/PackageCache/com.community.netcode.transport.photon-realtime@d862504b14/Runtime/PhotonRealtimeTransport.cs(518,17): error CS0012: The type 'NativeList<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Unity.Collections, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

The thing is that the Unity.Collections package IS installed in the project.

Can someone tell me how to fix this?

alexisprnt commented 11 months ago

Hey, have you found a solution for this ? I get this error too

tpitman commented 11 months ago

No. I decided to just switch to Unity's Transport layer and use Relay. Very disappointed in Photon.

WoodsFiend commented 8 months ago

Not sure if this functions yet as I am just spinning up new project, but it does eliminate the error. Find the photon asmdef file that is throwing the error "com.community.netcode.transport.photon-realtime" which is in /Packages. Add Unity.Collections as an Assembly Definition Reference and apply.

I suspect that upgrading is causing it to lose reference, but haven't verified if that asmdef has a similar ref when loaded in Unity 2021.

Pranj99 commented 1 month ago

Adding step by step guide in case anyone needs it -