Download

(Using AnimGraph/State Machines) Interrupt attack animation and play death animation

Hello!
Title says it all, I want to interrupt/cancel my player’s attack animation and play their death anim instead if they die before the impact hits. I’ve tried the usual transition rules, making a separate State Machine…I’m certain there’s plenty of ways to achieve this but for some reason I can’t find any tutorials on it (not ones involving AnimGraph at least, which is a must for my project).

Thank you very much in advance!

To activate the death of a player, it is necessary to verify variables such as that he is alive, and his amount of health. These variables within the state machine evaluate the jump to activate the animation. But if it is a question of interrupting an animation in an animation, you can think of notifications in montages animations.

Yes, I got that, I’m using a bool that becomes true the moment the player reaches 0 health. If that happens mid-combat, he completes his attack animation and then drops dead. I’m also familiar with notifies for animations, no matter what I try though it’s like the attack animation takes full priority. I haven’t come across this problem with any other animation in the game (and I’ve checked, they’re all set up in the same way) so I’m baffled as to what could the issue be.

Use assembly animations, they suspend the state machine and therefore its animations.

Another question, why not use the ragdoll effect?

I considered using that, but I prefer the look of a “real” animation instead of having the player wriggle on the floor lol. Thanks for the tip about assembly animations!

1 Like

I have a feeling this post is auto translated or something.
Wtf is an assembly animation?
Do you mean a montage?

In that case, I can see why you would resort to it for ease of use.
But in terms of stopping cheaters, it may be a lot better to just make sure every state machine can enter the dead state.

What you should be using montages for is the attacks…

Were you writing in English or using a different language that automatically translated “montage” to “assembly” ? If thats the case I would love to turn this new feature off…

Either way, yes.
Usually montages should be used for attacks because state machines have issues when it comes to attacking and reacting.

Whereas, a death state, even if animation less, prevents possible cheating by locking the player in that state.
Simply don’t hook the state back into anything.

1 Like

My native language is not English, I use a translator, but I think that if it is correct assembly for these animations, you can assemble different animations in one for example to make an attack combo.

Ragdoll/pose snapshot is a bit different from the concept of a montage (they really have nothing to do with one another).

But yes, using state machines also allows you to use the Pose Snapshot function.
Which is another reason to use an actual state machine for death states…

1 Like

Yes I agree, but in the video the montages are used to create the standing movement whether it is from the back or from the front behind the ragdoll.