2. Setting up the Animation Blueprint

Now that we have created our Blend Space, we need our Animation Blueprint to incorporate it. In this step, we alter the State Machine to include our Blend Space and hook up some variables that will be used to drive the parameter changes in the Blend Space for Speed and Direction.

Steps

  1. In the Content Browser under Content/AnimStarterPack open the UE4ASP_HeroTPP_AnimBlueprint.

  2. Inside the Animation Blueprint, click the MyBlueprint tab, then expand AnimGraph and Double-click Locomotion.

    AnimBP1.png

    This will open the State Machine used for this character which we will alter to use our created Blend Space.

    To see the process of setting up an Animation Blueprint from scratch for a character and incorporating character movement, please see the Setting Up Character Movement in Blueprints guide.

  3. Double-click on the Jog state to open its graph.

    AnimBP2.png

  4. Click the Asset Browser tab, then drag the Walk_Jog_BS into the graph.

    AnimBP3.png

  5. Replace BS_Jog with the Walk_Jog_BS Blend Space and connect Direction and Speed and feed it into the Result.

    AnimBP4.png

    The Speed and Direction will now drive our Blend Space animations (these values are updated based on the characters movement).

    Click image for full view

    You can view this on the Event Graph of the Animation Blueprint. These values are being set by the Player Character's movement.

  6. Click Compile and Save then close the Animation Blueprint.

End Result

The Animation Blueprint is set up, however we need to provide a method of changing the Speed and Direction values inside our Character Blueprint. Once we do so, we will be able to blend smoothly between walking/jogging states.