Reputation: 11
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, as well as if I directly close the game from the Unity Editor:
NullReferenceException: Object reference not set to an instance of an object
Unity.Netcode.NetworkVariableBase.MarkNetworkBehaviourDirty ()
What is the cause of this error?
Upvotes: 0
Views: 62