Hello. Since I’ve upgraded from 1.0.0-pre.7 to pre.9 I’m getting the following generator errors (same happens with pre.8):
(0,0): error - System.NullReferenceException: Object reference not set to an instance of an object.| at
Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.Process(ICompiledAssembly compiledAssembly) in
Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.9/Editor/CodeGen/INetworkSerializableILPP.cs:line 116 at
Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.Process(ICompiledAssembly compiledAssembly) in
Library/PackageCache/com.unity.netcode.gameobjects@1.0.0 pre.9/Editor/CodeGen/INetworkSerializableILPP.cs:line 116
Hi, did you find a solution to this? I just started getting this today too - I have added a new object for serialisation and there are generics involved so I’m wondering if there’s an issue there.
This minimal code below causes the error. If I comment out T data (Making the class useless of course) then it’s fine.
public class PrivateClientData<T> : NetworkBehaviour where T : INetworkSerializable, IEquatable<T>
{
T data;
}
I did sort of worked around the issue by changing the code in Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.9/Editor/CodeGen/INetworkSerializableILPP.cs. I added a ? after Resolve().
I wish someone from Unity would actually look in to this
Thanks for the reply - I abandoned this completely but good to see you found a solution. I wish there was more action on Unity’s part for these sorts of things. I’m getting a NetworkList sync issue now (Not syncing to standalone clients)…
This issue (a null reference in the ILPP code when creating a generic inheriting from NetworkBehavior) is fixed in 1.0.0-pre.10 which is available now. Please update and give it a try.
As for the NetworkList sync issues mentioned by AaronKB, this is being tracked in github and we’re looking for someone who can provide a minimal repro as we cannot reproduce this internally.