State Machine Animation Events not Triggering when Montage is Playing

Hi everyone,

I have a bit of an issue with animation notifies within a state machine not triggering if there is a montage actively playing within the Blueprint. Here is my set-up:

https://i.gyazo.com/4b459b9f86c986e731b2b2bbb84ad0ef.png

I have an animation notify on the “Primed Attack” node like so:

https://i.gyazo.com/03ab221aa0252e5b1d7ea0a3fa00c9d8.png

The idea is when a player wants to perform a melee attack, they click and hold the attack button. This then blends them into the “Primed Attack” node, which upon becoming fully blended will then flag them as able to launch their attack upon releasing the attack button. The EndPrimeAttack event just sets that flag. If the player releases the attack button before the state is fully blended, it will launch the attack as soon as the blend is finished.

In normal play, the system works perfectly. The issue I have is that if the animation blueprint is playing a montage (e.g. an idle animation or pain animation) then it messes with the blend. It appears as though it jumps instantly to the Primed Attack state, and because EndPrimeAttack is never triggered the player is stuck in the primed pose and cannot release their attack.

This seems to happen even if I interrupt the montage. For example, if the player clicks the attack button and holds it while an idle animation is playing, it instantly interrupts the montage and blends them in to the correct state. However, releasing the attack key does nothing and they’re now stuck in the primed pose.

One option is to set an on blend out delegate to every montage checking to see if the player should be able to prime a melee attack, but that is going to be a real pain and I would rather avoid that if possible.

Note: I tried moving the event trigger to the transition itself, to the End Transition event, same problem occurs.

Any advice would be much appreciated! I’m sure I’ve just missed a magic checkbox somewhere…

Have you tried to have a look at

`ShowDebug ANIMATION
to determine what state is “heaviest”?

Other than that I would need more info on the current setup, but the solution would be BP/C++ based here rather then animation based.

One thing you can double check too though, is OOP: order of operation.
Which comes first / which after in the animgraph?
Does the Slot blend for montages blend Onto the locomotion, or does the locomotion blend into the montages?

I have fixed somewhat similar issues by having several slots on the montages - one at the spine and the other as Whole Body (for things like a death montage for instance).

use the cached locomotion to the upper-body slot and cache a new pose.

Blend the locomotion onto the new pose with a Layerd Blend per bone (on spine_01) (like you normally would really) - save to yet another pose.

Lastly override this whole montage “yet another pose” from before with the other slot into a new cached pose (called full body in my case)

Then proceed as usual (which is leg ik/whatever else up into Final Animation Pose)

Doing so in that order prevented issues where the underlying animation was randomly changing, which wasn’t random at all, just caused by the montage lifting Off the ground in my case.

@ - I can confirm this issue, so far I tested it on two different projects and it’s 100% reproducible. This is what I found out:

If character changes states in the state machine while playing an anim sequence or an anim montage:

  • “Entered State Event” will fire, but “Left State Event” and “Fully Blended State Event” won’t;

  • “Start Transition Event” and “End Transition Event” won’t fire, but I guess this is correct behavior, since Transition Events refer only to transitions between states inside the state machine, and not between anim sequences/montages and the state machine…

EDIT: I just posted this in the AnswerHub as a bug report:

1 Like

The issue is under analysis in Unreal Engine Issues and Bug Tracker (UE-79507)

There’s a voting system there, if you are interested, go there and vote on this issue.

2 Likes