override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (Time.time >= rechargeEndTime) { animator.SetTrigger("CooldownFinished"); } else { buttonScript.SetOverlay(); } }