Unusual Error in version 1.5.1
See original GitHub issueDescription
Project fails to compile after updating to 1.5.1
Reproduce Steps
Update to version 1.5.1
Actual Outcome
Receive a code generation error (Looks related to that null ref check that was added)
Expected Outcome
Project works
Screenshots
Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP: (0,0): error - System.NullReferenceException: Object reference not set to an instance of an object.|| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.GenerateVariableInitialization(TypeDefinition type)|| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.GenerateVariableInitialization(TypeDefinition type)|| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.ProcessNetworkBehaviour(TypeDefinition typeDefinition, String[] assemblyDefines)|| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.<>c__DisplayClass7_0.<Process>b__1(TypeDefinition b)|| at System.Collections.Generic.List
1.ForEach(Action1 action)|| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.Process(ICompiledAssembly compiledAssembly) at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.GenerateVariableInitialization(TypeDefinition type)|| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.GenerateVariableInitialization(TypeDefinition type)|| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.ProcessNetworkBehaviour(TypeDefinition typeDefinition, String[] assemblyDefines)|| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.<>c__DisplayClass7_0.<Process>b__1(TypeDefinition b)|| at System.Collections.Generic.List
1.ForEach(Action1 action)|| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.Process(ICompiledAssembly compiledAssembly)
Environment
- OS: Windows
- Unity Version: 2022.3.0
- Netcode Version: 1.5.1
Additional Context
Really sorry about the super short bug report. My team is on a very tight deadline right now, so I only had 30 min to tests the new netcode version update. Hopefully what I posted above is helpful!
Issue Analytics
- State:
- Created 3 months ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
for those who are struggling, here is solution. The trick is to not use Generic type variables
I confirm the same regression. since Unity 2022.3.4f doesn’t let you chose the 1.4 version in the package manager, you can downgrade your version of NGO by changing
"com.unity.netcode.gameobjects": "1.5.1",
to"com.unity.netcode.gameobjects": "1.4.0",
in your ProjectName/Packages/manifest.json