public void MoveToLocation(Vector3 targetPoint) { animator = GetComponent <Animator>(); if (basicAttackEnabled) { action.ActionBasicAttackCancel(); basicAttackEnabled = false; } if (!animator.GetBool("Run")) { animator.SetBool("Run", true); } agent.destination = targetPoint; agent.isStopped = false; destination = true; }