Language:
Page Info
Tags:
Skill Level:
Engine Version:

4 - Finalizing the Blend Settings

In this final step, we define the method in which to layer our blended animation and which bone to start the blend from.

  1. Inside the AnimGraph of UE4ASP_HeroTPP_AnimBlueprint, click on the Layered blend per bone node, then expand the Layer Setup section and click the + sign.

    Animations17.png

  2. Under Bone Name enter spine_01, then set Blend Depth to 1 and check Mesh Space Rotation Blend.

    Animations18.png

    With these settings, we can blend the shooting AnimMontage onto our Skeleton starting from the spine_01 bone.

  3. Inside the MyBlueprint window, open the EventGraph.

    Animations18b.png

  4. Drag off the As Ue4ASP Character pin of the Cast To Ue4ASP_Character node and add the Get Fire Button Down node.

    Animations19.png

    This will tell us if the player is pressing the fire button or not.

  5. Hold B and Left-click in the graph to create a Branch node and connect it following Set Crouching.

    Animations20.png

    For the Condition, plug in the FireButtonDown pin.

  6. Right-click in the graph and add the Montage Is Playing node and assign Fire_Shotgun_Ironsights_Montage.

    Animations22.png

  7. Off the Return Value of the Montage Is Playing node, add a Branch.

  8. Connect the Branch from Step 5 to the new Branch as shown below and add a Montage Play node with Montage to Play set to your Montage.

    Animations23.png

    This will check now if the Montage is currently playing and if it is, do not play it (and if it is not, play the Montage).

  9. Compile and Save, close the Blueprint and delete the existing ThirdPersonCharacter in the level.

    Animations24.png

    This will allow us to use our selected character defined in our Game Mode and not the one placed in the level.

  10. Play in the editor.

End Result

You will see that when you hold the Left Mouse Button down, the character will play the shooting AnimMontage. You can walk around while shooting, you can even crouch (by holding C) and shoot as well. You could use this same guide to play a melee attack, reload animation or any other animation that you want to be able to do while moving around.

The UpperBody slot that we created and assigned in our Animation Montage can be assigned in other Animation Montages as well. Since our AnimGraph has the Slot node assigned, whenever we call to play an Animation Montage that has that slot assigned, it will get played with our defined settings.

Tags