I currently have a locomotion blendspace that applies left and right lean animations to my run. I also have a blendspace for my idle animation which applies look at animation for the camera movement. I would like to also apply a look at blendspace to the run so it isn’t jarring to see the character’s head immediately turn to the side when you stop running and it goes back to the idle animation. Is there a way to incorporate both a lean blendspace and look at blendspace to the run?
Hi there, yes you can achieve this you’d need to create a layered blendspaces and managing their blending weights through animation states or animation blueprints.
Something along these lines:
- Create Separate Blendspaces:
- Ensure you have a blendspace for running with leaning (let’s call it
RunLeanBlendspace
). - Create a blendspace for the look-at functionality (let’s call it
LookAtBlendspace
).
- Set Up Animation Blueprint:
- Open your Animation Blueprint and navigate to the Anim Graph.
- Create a State Machine:
- If you don’t already have a state machine for locomotion, create one. Add states for
Idle
,Run
, and any other movements you have.
- Add Blendspaces to the Run State:
- In the
Run
state, you will blend theRunLeanBlendspace
and theLookAtBlendspace
.
- Use a Blend Node:
- Inside the
Run
state, use aBlend by Bone
node or aLayered Blend per Bone
node. This allows you to blend animations while specifying different bones for blending.
You’d also most likely want to look into using the layer per bone…
- Add Layered Blend Per Bone Node:
- In the Anim Graph, inside the
Run
state, add aLayered Blend per Bone
node.
- Connect Blendspaces to the Layered Blend:
- Connect your
RunLeanBlendspace
to theBase Pose
input of theLayered Blend per Bone
node. - Connect your
LookAtBlendspace
to theBlend Pose 0
input of theLayered Blend per Bone
node.
- Configure Bone Blending:
- In the
Layered Blend per Bone
node, configure theLayer Setup
. - Add an entry to the
Branch Filters
and set it to the neck or head bone. This ensures that the look-at blendspace only affects the head/neck bones.
- Blend Weights:
- Control the blend weights dynamically. For instance, you can use a
Blend Weight
parameter to smoothly transition the influence of theLookAtBlendspace
.
Hope this helps.
Amazing, thank you! This is very thorough and will probably help me get this done. I’ll try implementing this soon and I’ll reply back here with results. Thanks again!
1 Like