Play specific animation and return to idle

Hi!

I stumbled across a problem.

I need to be able to play specific animations on a character from blueprint, and then return to it’s normal ABP behaviour. The problem here is that Play Animation node clearly does not work like that, character never returns to it’s ABP.

And almost every answer on this same question in other threads leads to the same answer - Animation Montage. Ok. Well. In those answers it seems like I need to create Animation Montage for every animation I want to play. What if I have a hundreed animations? A thousand? Do I need to create Animation Montage for each one of them?

Even for much less animations it does not sound like efficient solution…

How should I approach this problem?

As example I could suggest a fighting game with a lot of moves and randomly shuffled animations.

Thanks!

Animation Montage is the best solution for one off animations. Another alternative is to use a State Machine.

State Machine is what I normally use and prefer to use. So I did try this, I tried using a “Attacking” state, and changin animations there, from a variable or from a Blend by Int.

Each approach felt elegant enough, but they both failed. I did not find a way to force animation restart in the first one. And Blend by Int does not restart\reset animation unless you change int\blend animation there.

So, I’m looking for somewhat elegant way to dynamically play animations on a character from Character BP, not from ABP. Or assigning animation to ABP from Character BP, which would probably be ideal.

If there is such a way.

Jsyk, I ran into the same problem you had.

tl;dr
For semi-complex Actors (namely, characters), I suggest you DO NOT play animations from anywhere other than the AnimBP. I’d only use Play Animation node for very simple actors; things that use only a few animations. For these characters you don’t need to create an AnimBP. Just play all their anims in their main BP.

I had a basic state machine that handled all the animation states. Then I came up with the great idea of playing a single one shot animation in the Character BP. Then I noticed my character never reverted back to his state machine animations. I think this is the same issue you’re seeing. I don’t think it’s documented anywhere, but I’m pretty sure whenever you play an animation from anywhere outside of the Anim BP, the Character’s anim instance gets set to Null or something, so it’ll never revert back to it.

Lastly, Anim Montages are extremely powerful, but I’m pretty sure you don’t need one to get what you want done.

Can you post some screens of your setup that’s not working?

Anim montages give you the most control over animations.

If you want to call specific animations from the Character BP, you can easily do that. Just set up a variable in the Character BP that the AnimBP has access to, then do checks for it in your state machine.

If you’re looking for a way to just make the animation restart from the beginning every time, without blending maybe this li’l checkbox will help?

Update: I can’t find out a way to toggle “Always Reset On Entry” outside of the state machine. If there isn’t a way, and, depending on the situation, you want it to blend, you’re probably going to have to create another state with it unchecked to get the blending.

Thats it! Thanks, I did not find that checkbox myself, “Events” rollout is closed by default and I did not notice it. Ha!

Yes, my setup was exactly that, ABP grabs a Animation Sequence variable from Character BP, and feeds that into Play Animation Sequence node in “Action” (“Attack” in my case) state.

Thanks! This is perfect.

One issue, though, it seems that it ignores any blending?

Will probably have to find a workaroud for that. Right now thinking about maybe switching between 2 simialr states? Like a flipflop sort of thing