// Update is called once per frame void Update() { // Comprueba si ve al jugador RaycastHit hit; if (visionController.canSeePlayer(out hit)) { navMeshController.pursuitEnemy = hit.transform; stateMachine.ActivateState(stateMachine.PursuitState); return; } if (navMeshController.Arrive()) { nextWayPoint = (nextWayPoint + 1) % WayPoints.Length; UpdateDestinyWayPoint(); } }