1. Setting up the Blend Space

Choose your OS:

In this first step, we set up our Blend Space to move between several different animations based on values of two parameters.

For this guide, we have created a new project using the Blueprint Third Person template with Starter Content enabled. We are also using animations that are included in the Animation Starter Pack which is available for download for free via the Marketplace. Once downloaded, add this pack to your project via the Add to Project button from the Launcher and proceed to the steps below.

AnimStarterPack.png

Steps

  1. In the Content Browser under Content/ThirdPersonBP/Blueprints, open the ThirdPersonGameMode Blueprint.

  2. Under Default Pawn Class, click the dropdown menu and select the Ue4ASP_Character.

    HowTo1.png

    This will set the default character pawn to use the one provided with the Animation Starter Pack.

  3. Compile and Save then close the Blueprint.

  4. In the Content Browser, click the Add New Button then under Animation, select Blend Space.

    HowTo2.png

  5. In the Pick Skeleton window, select the bottom UE4_Mannequin_Skeleton.

    HowTo3.png

    This refers to the Skeletal Asset that came with the Animation Starter Pack.

  6. Name the Blend Space Walk_Jog_BS (you can also move it to the AnimStaterPack folder if desired).

    HowTo4.png

  7. Open the Walk_Jog_BS, then in the center window under the Parameters section, enter the values shown.

    HowTo5.png

    Set the X Axis Label to Direction and its range to -180 to 180. Set the Y Axis Label to Speed and its range to 150 to 270. With the values set, click the Apply Parameter Changes button which will make the grid space to the left update with your values. Here we are defining the parameters that will determine the motion the Blend Space will produce based on the variables Direction and Speed (clamped by the range provided) which we will get from the player character.

  8. From the Asset Browser window, drag the Walk_Fwd_Rifle_Ironsights animation into the graph at the bottom center location.

    HowTo6.png

  9. Drag the Walk_Lt_Rifle_Ironsights animation to position 1 and the Walk_Rt_Rifle_Ironsights animation to position 2 below.

    HowTo7.png

  10. Drag the Walk_Bwd_Rifle_Ironsights animation to position 1 and 2 below.

    HowTo8.png

  11. Drag the Jog_Fwd_Rifle animation into the grid in the top center location.

    HowTo9.png

  12. Drag the Jog_Lt_Rifle animation to position 1 and the Jog_Rt_Rifle animation to position 2 below.

    HowTo10.png

  13. Drag the Jog_Bwd_Rifle animation to position 1 and 2 below.

    HowTo11.png

    If you move your mouse around inside the grid, you will see the character start to blend between the different walk/jog animations.

  14. Inside the Anim Asset Details window under Sample Interpolation, set Target Weight Interpolation Speed Per Sec to 4.0.

    HowTo12.png

    This will smooth out the transition between the animations in the Blend Space to prevent popping from pose to pose.

  15. Click Save to save your Blend Space setup.

End Result

You can now preview your Blend Space by moving your mouse inside the X/Y Grid. Moving near the lower end of the grid will cause the character to walk, while moving up near the top of the grid will cause the character to start to jog. If you are not seeing the character move, make sure that Enable Preview BlendSpace option is checked under the Samples section.