I have set up my 3rd person characters movements using state machine in my animation blue print. Generally it works very nicely. But I have one bug that I seem not be able to fix.
My character can do the following: stand idle, walk, run, jump/fall, block with shield and without (different animations), 3 different randomized standard melee weapon attacks, 3 different power/special attacks, being hit, die. The power/special attacks can only be done while standing/not moving and this is intended. For the 3 different standard melee attacks my character is allowed to perform either while idle, walking or running. But here I’m running in a problem. Standing and moving standard attacks work fine by itself, but if my character is moving and I do a standard attack and stop walking/running by releasing the W button while the standard attack animation is played, the legs keep moving (walk or run animation) even when the character has no forward movement until the attack animation is over. I haven’t found a way to fix that. Can anyone point me in the right direction for a solution? thanks.
No. You would need to share your whole state machine for someone to analyze the issue.
obviously, your lower body motion is being prevented from returning to idle.
The transition rules you are using must be faulty, or something you are doing somewhere else is setting the speed variable differently.
Ok, here are screenshots of my state machine and an example of one of the attack states with the bugs. How can I interrupt the leg moving part of this attack state when the the movement forward movement stops. By using “layered blend per bone” in the state can I even separate the movement of the weapon swinging upper body from the running lower body? Technically the legs should go in idle position while the upper body finishes the movement. But I start wondering if my approach with “layered blend per bone” is even the correct way. Where would I tell the state machine to stop moving the legs when speed is 0? In the Event Graph I have a boolean variable “IsMoving” for speed larger than 0. Can I use this boolean in the state machine somewhere to fix this?
in an effort to avoid such situations it would be better if you refactor the whole animation BP.
You want one stare machine for motion.
and another state machine for attacks.
You cache both poses, and you can then use cached results within the statemachines.
A blatant example of this is any paragon character’s Jump additive cycle.
That said.
Yes. Your issue is the blend node.
You are telling the engine to blend a blendspace to an attack basically attaching an animation to the upper body of whatever the lower body does.
You are coming in from a running state, and likely attempting to return to the running state only- while not running any longer.
The easy fix is to connect the attack state back to idle, and allow the transition when both “relevant animation time remaining” and speed are <= to 0.
This appear to be something all the other states do except for the top right running attack ones.
Scratch that, its really only double attack and spinning attack.
either way I think you need that same structure.
Hey MostHost LA, thanks a lot. That is exactly the push in the right direction I was looking for. I looked at tone of the Paragon characters and kinda get the idea. I might set the character animation blueprint up in a different way. Thanks again, as always, great help!!!