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?
(comments are locked)
|
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.
(comments are locked)
|
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...
(comments are locked)
|
Follow this question
Once you sign in you will be able to subscribe for any updates here