// Update is called once per frame void Update() { currentState.UpdateState(); #region FovCheck(player, 360); if (playerInSight == true && currentState != attackingState) { currentState.ToAttackState(); } float velocity = navMeshAgent.velocity.magnitude; if (velocity > 0.1f || navMeshAgent.updateRotation == false) { anim.SetBool("Moving", true); } else { anim.SetBool("Moving", false); } #endregion }