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

2 - Updating the Character Blueprint

In this step, we create some script inside our Character Blueprint to allow us to signal our Animation Blueprint that we are firing a weapon.

  1. Inside the Content Browser under Content/AnimStarterPack, open the Ue4ASP_Character Blueprint.

  2. Locate the Crouching section, and delete the InputAction Crouch Event (with the Warning!) sign.

    Animations6.png

    There is a warning on this node because our project is not set up to use the InputAction event "Crouch".

  3. Right-click in the graph and add a C Key Event and connect as shown below.

    Animations7.png

    We have just associated crouch now with the C key press, you can change this input to whatever you would like.

  4. In the MyBlueprint window, click the Add Variable button to create a Boolean variable and call it Fire Button Down.

    Animations8.png

  5. Right-click in the graph and add the Left Mouse Button Key Event.

  6. Holding Alt, drag the Fire Button Down variable in the graph to create a Set node.

  7. Repeat the previous step (or copy the Set node) and connect as shown below.

    Animations9.png

    Make sure that Fire Button Down is True when Left Mouse Button is Pressed and False when Released.

  8. Select CapsuleComponent in the Components window, then in the Details panel check the Hidden in Game option.

    HideCapsule.png

    This will turn off the debug display of capsule's collision.

  9. Compile and Save then close the Blueprint.

Our character is now set up to send signals to our Animation Blueprint when we are crouching or firing a weapon. In the next step, we will set up our Animation Graph inside our Animation Blueprint to handle the blending of our Anim Montage with our normal movement animations so that we can blend between the two.

Tags