# How to stop animation state normalized time to go beyond 1

I want the animation state normalized time not to go beyond 1 when it is not looped. I initially thought that it shouldn't do it anyway but the longer the animator stays in that state, normalized time will non-stop go forever.

I have created a StateMachineBehaviour and added the following code for the said state:

public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
var normalizedTime = stateInfo.normalizedTime;

if (normalizedTime > 1)
animator.Play(0, layerIndex, 1);
}


This simply checks if the normalizedTime has gone beyond 1 and if so, it resets it back to 1. This sadly comes back with tons of errors in the console though: "Invalid time range for Transition exit time condition" when there is a transition with has exit time checked and no transition will work.