private void Start() { // Find the active player defined by Become Script player = GameObject.FindWithTag("ActivePlayer"); // Get the NavMeshAgent components controller = GetComponent <NavMeshController>(); agent = controller.GetComponent <NavMeshAgent>(); }
void Start() { currentPatrolPoint = 0; // Get the NavMeshAgent component //agent = this.GetComponent<NavMeshAgent>(); controller = GetComponentInParent <NavMeshController>(); agent = controller.GetComponent <NavMeshAgent>(); // Enemy starts his round StartPatrol(); }