How do you code the end of an animation?


I would like to set SetBool to True and then False when the animation is over.

I accomplish this by adding a behavior to the state in the animation controller.

In the behavior I can use timer that matches the lenth of the animation.

Another way to stop the animation is to have a transition that occurs after it in the animation controller using the exit timer.

Another way is setting a variable that a transition in the animation controller with that condition to trigger an exit.

OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
  override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
			animator.SetBool("introCont", false);