Animation montage for blocking attacks

Hello,

I’m new to UE4, and would like to combine a few animations that play when an enemy swings with a melee weapon toward thea player’s character who is blocking with his weapon. Going through the UE4 beginner tutorials I found out about the Animation Montage feature and would like to use it in practice.

Would it be possible/practical to make an animation montage which starts with the attacker’s swing animation then if the attacker’s weapon collides with the blocking weapon, the attacker’s swing animation play backwards or some other animation as he retracts his arm and a particle effect is spawned at the point of collision?

Is there a better way to implement the animation part of a basic blocking system?

Thanks for help and sorry for bad English.

Hey, I’m pretty new aswell however, I seem to do pretty well ever now and then and have seen and tried a few techniques.

What I would try to do if i was doing somthing like that is:

Option A).

If you are using line tracing, you could trace by object, and when or if the line tracing hits the shield object you could tell it to play the animation you would like for example (your sword swing animation but in reverse). To reverse it i would suggest copying the animation and renaming it to something descriptive, then open it and change the rate scale to a negative value if you don’t actually have a legit animation for it.

This might work.

Option B)

  1. Open up sword swing animation, and on the “Notifies” bar, Right click on the notifies bar around about the time where you think the animation for sword swing would hit its target (helps if you click pause and drag the timeline along manually) / Add Notify / Add New Notify./ Rename the Notify something like (WasBlocked? or HitShield?)

  2. In AnimBP / Event Graph & your CharacterBP Event Graph i think you would need to create a variable called something like (WasBlocked?, DidBlock? Blocked?)

  3. Go to AnimBP Right Click / type in (the name of your Notify that you created in the animation), drag out to a branch and Get the Variable that you just created and hook it up to the condition of the branch.

  4. Then from the branch, i would play around with something like, Drag out from the True part of the branch and hook it up to play the flinch animation. From there you can see if it actually worked.

For it to work though, you would still need a way to call the Blocked variable you created when the weapon hits the shield,

So actually combining option A & B together could also work. But im also new and i may have also made this more complicated than it might need to be haha

let me know if anything helped.

Kind Regards!

Thank you, these options helped alot.

Makes me happy to see that!