Animation State Machine not resetting non-looping animation

I have this state machine, that goes from a “Walking” state, to an “Attack” state with a Can Enter Transition set to when the “Attacking” bool is set.

That same bool is then later unset once we are fully within the “Attack” state.

The attack state simply has a “Play hero_attack” node that is set to not loop, this generally works nicely, as it starts playing when you begin the state transition into attack.

the exit transition is “hero_attack asset, Time Remaining” <= 0.0 so this exits the state when the animation is done.

Now this works generally very well. The problem is when the “Attacking” bool gets reset to true before we are fully transitioned back into “Walking” I think this is triggering a transition interrupt which reenters the Attack animation, but without resetting the “hero_attack” animation, it then tries to transition right back out, getting stuck in a loop trying to enter and leave repeatedly.

Is there anyways I can prevent it from doing this interrupt, thus fully exiting the Attack state, and ensuring the animation gets reset everytime?

While this doesn’t seem like the proper or only solution, I’ve worked around the problem by selecting the transition out of the throw and attack states, and changing BlendSettings → Duration to 0.0 This seems to prevent it from sharing the blend out and blend in, and thus giving the animation graph time to reset the playing node.

While this does solve my immediate problem. It does prevent the use of blending on that transition, which is unfortunate.

I have this issue as well, even though I’ve set the BlendSettings → Duration to 0.0 the animation won’t reset between states.

So I have a segmented reload section with variable blendspaces in the order Stage1 → Stage2 → Stage3 → Stage4 but after Stage1 is completed, Stage2 starts at the end of the animation as does the other states.

What’s going on? The Statemachine with blendspaces seems really broken.

You could use the “State Weight” node in the WalkingToAttack transition rule. Make it so that you cannot enter Attack unless Walking’s State Weight = 1.

This means you cannot enter attack state unless Walking is fully blended into. This prevents our issue but cause slight delays in terms of control responsivity.

You could use the “State Weight” node in the WalkingToAttack transition rule. Make it so that you cannot enter Attack unless Walking’s State Weight = 1.

This means you cannot enter Attack state unless Walking is fully blended into. This prevents our issue but causes slight delays in terms of control responsivity. A tradeoff…