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

Question DOES galacticKittens doesnt work anymore?

Discussion in 'Multiplayer Dev Blitz Day 2023 - Q&A' started by firebird721, Jul 20, 2023.

  1. firebird721

    firebird721

    Joined:
    Jun 8, 2022
    Posts:
    72
    i dowlloaded the galacticKittens from your site and i t has some problems - i wonder if it is on my end or does the galacticKittens sample doesnt work anymore?

    i put below the the error i get

    ************************************************
    maybe its related to this script

    using Unity.Netcode;
    using UnityEngine;
    /*
    Generic classes for the use of singleton
    there are 3 types:
    - MonoBehaviour -> for the use of singleton to normal MonoBehaviours
    - NetworkBehaviour -> for the use of singleton that uses the NetworkBehaviours
    - Persistent -> when we need to make sure the object is not destroyed during the session
    */
    public class Singleton<T> : MonoBehaviour where T : Component
    {
    public static T Instance { get; private set; }
    public virtual void Awake()
    {
    if (Instance == null)
    {
    Instance = this as T;
    }
    else
    {
    Destroy(gameObject);
    }
    }
    }
    public class SingletonPersistent<T> : MonoBehaviour where T : Component
    {
    public static T Instance { get; private set; }
    public virtual void Awake()
    {
    if (Instance == null)
    {
    Instance = this as T;
    DontDestroyOnLoad(this);
    }
    else
    {
    Destroy(gameObject);
    }
    }
    }
    public class SingletonNetwork<T> : NetworkBehaviour where T : Component
    {
    public static T Instance { get; private set; }
    public virtual void Awake()
    {
    if (Instance == null)
    {
    Instance = this as T;
    }
    else
    {
    Destroy(gameObject);
    }
    }
    }
    public class SingletonNetworkPersistent<T> : NetworkBehaviour where T : Component
    {
    public static T Instance { get; private set; }
    public virtual void Awake()
    {
    if (Instance == null)
    {
    Instance = this as T;
    DontDestroyOnLoad(this);
    }
    else
    {
    Destroy(gameObject);
    }
    }
    }

    ******************************
    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(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.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)
     
  2. NoelStephens_Unity

    NoelStephens_Unity

    Unity Technologies

    Joined:
    Feb 12, 2022
    Posts:
    49
    @firebird721
    What version of Unity are you currently using?
     
  3. firebird721

    firebird721

    Joined:
    Jun 8, 2022
    Posts:
    72
    2022 lts or last one - 2023.15 (maybe the paccakges also not correct somhow?)
     
  4. Esteban_DevAdvocate

    Esteban_DevAdvocate

    Unity Technologies

    Joined:
    Feb 7, 2020
    Posts:
    2
    Hello and thank you for letting us know!

    I was in the middle of updating GK to use 2022.3 + latest NGO (1.5.1). A fix for this was introduced in the NGO repo, and if I'm not mistaken, it'll be included in NGO (1.5.2):
    https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/2603

    ATM, I recommend that for now you use latest NGO from the github repo, or use NGO(1.4.0), which worked fine.
     
    firebird721 likes this.
  5. Esteban_DevAdvocate

    Esteban_DevAdvocate

    Unity Technologies

    Joined:
    Feb 7, 2020
    Posts:
    2
    But please let us know if the problem persists :)