Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Why Netcode for GameObjects 1.5.1 doesn't target 2022.3

Discussion in 'Netcode for GameObjects' started by Mj-Kkaya, Jun 15, 2023.

  1. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    156
    I tried to upgrade the Unity version from 2021.3 to 2022.3 after Netcode 1.5.1 upgrade but I got this error:

    Code (CSharp):
    1. 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.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(Action`1 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.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(Action`1 action)|   at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.Process(ICompiledAssembly compiledAssembly)
    Then I looked at requirements and saw this text.

    Netcode for GameObjects targets the following Unity versions:
    Unity 2020.3, 2021.1, 2021.2 and 2021.3

    Is there any reason this?
    Will 2022.3 version be target?
    Or 2022.3 will just focus Netcode for Entities?
     
  2. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    156
    I don't think this error is related to the version.
    Because I get this error 2021.3.26f1


    (0,0): error - System.NullReferenceException: Object reference not set to an instance of an object.| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.GenerateVariableInitialization(TypeDefinition type) in /Users/mjkkaya/Workspace/Project/Unity/MultiplayerGamePrototype/Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Editor/CodeGen/NetworkBehaviourILPP.cs:line 2228| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.ProcessNetworkBehaviour(TypeDefinition typeDefinition, String[] assemblyDefines) in /Users/mjkkaya/Workspace/Project/Unity/MultiplayerGamePrototype/Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Editor/CodeGen/NetworkBehaviourILPP.cs:line 1149| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.<>c__DisplayClass7_0.<Process>b__1(TypeDefinition b) in /Users/mjkkaya/Workspace/Project/Unity/MultiplayerGamePrototype/Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Editor/CodeGen/NetworkBehaviourILPP.cs:line 77| at System.Collections.Generic.List`1.ForEach(Action`1 action)| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.Process(ICompiledAssembly compiledAssembly) in /Users/mjkkaya/Workspace/Project/Unity/MultiplayerGamePrototype/Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Editor/CodeGen/NetworkBehaviourILPP.cs:line 74 at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.GenerateVariableInitialization(TypeDefinition type) in /Users/mjkkaya/Workspace/Project/Unity/MultiplayerGamePrototype/Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Editor/CodeGen/NetworkBehaviourILPP.cs:line 2228| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.ProcessNetworkBehaviour(TypeDefinition typeDefinition, String[] assemblyDefines) in /Users/mjkkaya/Workspace/Project/Unity/MultiplayerGamePrototype/Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Editor/CodeGen/NetworkBehaviourILPP.cs:line 1149| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.<>c__DisplayClass7_0.<Process>b__1(TypeDefinition b) in /Users/mjkkaya/Workspace/Project/Unity/MultiplayerGamePrototype/Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Editor/CodeGen/NetworkBehaviourILPP.cs:line 77| at System.Collections.Generic.List`1.ForEach(Action`1 action)| at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.Process(ICompiledAssembly compiledAssembly) in /Users/mjkkaya/Workspace/Project/Unity/MultiplayerGamePrototype/Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Editor/CodeGen/NetworkBehaviourILPP.cs:line 74
     
    Last edited: Jun 15, 2023
  3. xyvan

    xyvan

    Joined:
    Jun 21, 2014
    Posts:
    13
    upgraded to 2022.3 same error
     
  4. hsu4817

    hsu4817

    Joined:
    Jun 20, 2023
    Posts:
    1
    I had same error in Unity 2021.3.14f1.
    It seems that using generic type inheriting networkbehaviour make this error.
    In my case, downgrading Netcode version to 1.3.1 solved this problem.
     
  5. SamuelAsherRivello

    SamuelAsherRivello

    Joined:
    Jan 16, 2011
    Posts:
    36
  6. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    156
    Yes that is works, but the idea of this thread is not find solution. It is about question and bug report.
     
  7. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    156
    I found the solution, if you gettin same error please visit github page.