So when I go from Scene 1 to Scene 2 everything is working but when I try to go back to my first Scene its giving me this message:
NullReferenceException: Object reference not set to an instance of an object
RPG.Movement.Mover.RestoreState (System.Object state) (at Assets/Scripts/Movement/Mover.cs:98)
}
public void RestoreState(object state)
{
SerializableVector3 position =(SerializableVector3)state;
navMeshAgent.enabled = false;
transform.position = position.ToVector();
navMeshAgent.enabled = true;
GetComponent<ActionSchedular>().CancelCurrentAction();
}
I wonder what’s the problem cause with all other Scenes its working super well.