public class Generate : NetworkBehaviour
{
private NetworkVariable<float> decreament = new NetworkVariable<float>(10);
void Update()
{
decreament.Value -= Time.deltaTime;
}
}
This code gives me an error when I run this code in Unity and start the host and If I directly close the game from the unity editor then this code gives me
NullReferenceException: Object reference not set to an instance of an object
Unity.Netcode.NetworkVariableBase.MarkNetworkBehaviourDirty ()
this error in console.
I’m new in Unity and I Don’t know How to resolve this problem ….
Can Anyone explain this error to me …