Start animation again

Hi. I have a prefab that has an animation. How can I start this animation again before the playing animation ends?

Please explain this with more detail so we can understand the setup. Does ‘has exit time’ setting help with your problem?

If I understand what you are asking, you want to restart the animation before it stops playing? There are a few ways to do this. You can add an animation event somewhere in the timeline of the animation and call a function. In that function you can simply tell the Animator to Play(string animationName) the animation again, but you will need to make an exit condition.

If you simply want to loop the animation, just open the animation clip and enable looping by clicking the check box “Loop Time”, or in the Animator, enable Looping by checking the box “Loop Time”

As theANMATOR2b indicated “Has Exit Time” will force the animation to continue playing until it is done if you have it on. In the Animator, you can also make a transition from the Animation to itself and set a conditon for it to play again.

Hope that helps.

1 Like

Thanks