The standard Idle/Walk/Run → Jump state machine is fine, but I want to improve on this.
I have one jump animation for Idle/Walk and another jump animation for Run/Sprint. How to trigger the correct animation?
My guess is two state machines, each with the same I/W/R Blendspace, but with different jump loops, and then a Blend Pose by Bool to select from between the two on (Speed > X).
Hi! You can simply create two different transitions from IWR BlendSpace to IW_Jump chain and then to R_Jump chain. Just set the conditions with accuracy. However, there can be some drawback - you will have one constant to define Run in BlendSpace asset and you will need another to set up transition conditions
I considered that, but it doesn’t seem efficient to have two transitions branching off the same blendspace. I’m new to this, so maybe that’s commonly done?
Or, are these jump chains in a transition sequence?
[IWR] → (if spd < 300) → [Standing Jump] → (if spd > 300) → [Running Jump] → [Final Pose]
Create a blendspace with 1 axis for velocity. Put your stationary jump anim sequence on the left (0) and your running jump anim sequence on the right (which is set to whatever speed you want the running animation to be used). Then use that blendspace in your state machine instead of your jump animation. In your event graph for the anim blueprint, set the speed of your pawn to a variable so it use in the state to be sent to the blendspace. See screenshots, this is how I did what you are trying to do.
Well, only if the two other states have different animations if you are running. I would expect the looping and end animations to be the same. But even if they aren’t all you need to do is use three blend spaces instead of the animations. You can substitute a blend space in any spot you have a animation sequence and feed in variables based on the situation. You could even do a 2d blend space and add in direction, so you could make running_jump_left/right etc. Since blend spaces take seconds to put together its well worth it to replace the animations for them.
My jump animations were made from the same starting point as the run/jog animation, so they stitch together pretty well. But honestly, the animations switch quick enough and Unreal does a good job of blending them, that it would be hard to notice any differences unless your animations were drastically different or you slow it down and look at it frame by frame.