Play random StateMachine animation

This is what I have now:

But that does not work because it goes forth and back between the two animations every frame. Thus the animation becomes jittery.

I could make a separate State for each animation but that would be absolute horror for the StateMachine (the amount of transition-arrows there would quickly accumulate to insane amounts). How is this best done?

You can use the delta time from event graph tick to set an integer in a pre defined interval and blend animations by this int.

First create these variables in the event graph from the anim blueprint:

220688-ueanswer1.png

Set the IntervalBetweenAnimations to the time you want to have between animations and then add this to the event graph :

Now all you need to do is blend poses by int, using the value of AnimationNum

220690-ueanswer2.png

If you need animations to happen with different intervals between them, you can set a random int on every tick and use a state machine to check the animation time remaining. You also can create an array of intervals ints, and use the AnimationNum variable as its index.

I was hoping for a more elegant solution but it works.

I guess the more elegant solution would be use the state machines, but I don’t know if you want to wait the full animation or set a custom interval.

Wait for the full animation.