Complete a looping animation before transition

How do I complete a looping animation before transitioning? I want it to loop for an indefinite number of times. Randomly, I’ll say “CrossFade” and I want to finish the current loop cycle before moving to the next animation.

HOW do I do that?

“crossfade after animation completes”

I might need to do this a lot in my 2D (traditional animation) game so bloating the controller with a million bools or triggers is no good.

anybody?

check for animator state normalized time. but if it loops it keeps counting on

Check “has exit time”

@dibdab
So I’ve got to busy wait or sleep until the animation is over? There’s no build in method to queue up an animation after a loop ends?

@the_0dium
Has exit time will exit after the first loop unless I use trigger/bool for every single instance of these transitions which won’t work since I might have a lot of them.

Sounds like it’s not possible with the Animator.

@the_0dium
Has exit time will exit after the first loop unless I use trigger/bool for every single instance of these transitions which won’t work since I might have a lot of them.[/QUOTE]
How do you expect to create transitions without using bools for them then?

I often use Play or Crossfade. I was hoping I could use Crossfade with a parameter to specify that it should wait for the current loop iteration to finish. Better yet, the original animation component had a queue animation. That’d do it too. Neither of those are options with Animator so it’s just not possible. You have busy wait or bloat up your controller with a bunch of variables.

Are you telling me that Animator Controllers become a hacky mess when trying to implement even simple logic like waiting for an animation to end?

2 Likes