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
Runstate, you will blend theRunLeanBlendspaceand theLookAtBlendspace.
- Use a Blend Node:
- Inside the
Runstate, use aBlend by Bonenode or aLayered Blend per Bonenode. 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
Runstate, add aLayered Blend per Bonenode.
- Connect Blendspaces to the Layered Blend:
- Connect your
RunLeanBlendspaceto theBase Poseinput of theLayered Blend per Bonenode. - Connect your
LookAtBlendspaceto theBlend Pose 0input of theLayered Blend per Bonenode.
- Configure Bone Blending:
- In the
Layered Blend per Bonenode, configure theLayer Setup. - Add an entry to the
Branch Filtersand 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 Weightparameter 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