// Seek for a new target void SeekNavigationTargetAfterAttacking() { // While debugging do not change the target GameObject newNavTarget = MainObjectManager.Instance.GetRandomActiveBlock(); if (newNavTarget == null) { Debug.LogError("There is not target to be navigated to in the scene"); return; } if (!newNavTarget.activeSelf) { Debug.LogError("The target of the zombie " + gameObject.name + "is not enabled"); } ResumeNavigation(); attack_target.Assign(newNavTarget); // Calculate the path if (!agent.SetDestination(attack_target.nav_target.position)) { Debug.Log("Zombie " + gameObject.name + "has failed to calculate a path"); } zombieStateMachine.State = ZombieStateMachine.ZombieStateEnum.Walking; }