Language:
Page Info
Skill Level:
Engine Version:

4 - Finishing Up

Choose your OS:

In this final section, we will update our Character Blueprint to change how controller rotation is handled as well as fix some minor issues before testing.

Steps

  1. In the Content/AnimStarterPack folder, open the Ue4ASP_Character Blueprint.

  2. Cick on Ue4ASP_Character in the Components window, then in the Details uncheck Use Controller Rotation Yaw.

    step4_04.png

    This will prevent the character from automatically turning to the location of the Controller's yaw.

  3. Cick on CapsuleComponent in the Components window, then in the Details check the Hidden in Game option.

    HideCapsule.png

    This will hide the debug collision display during gameplay.

  4. Click the EventGraph in MyBlueprint, then find the Crouching section and replace the InputAction Crouch node with a C Key Event.

    step4_05.png

    This will remove the yellow warning sign on the compile button in the upper left corner of the window since the project does not have an Action Mapping for Crouch by default, we are going to use the C button to crouch (you can use any Key Event you wish for this).

  5. Compile and Save then close the Blueprint

  6. Remove the ThirdPersonCharacter from the level.

    DeleteCharacter.png

    This will make sure that we use the character assigned to Game Mode and not the one placed in the level.

  7. Click the Play button to play in the editor.

End Result

When you play in the editor, the character will now aim while stationary and will react to mouse movement, pointing in the direction of your mouse. There are some restrictions in place that prevent the character from turning and facing backward while the mouse is behind them as well and while the character is jogging, moving the mouse also turns the character's torso in the direction you are pointing.

You can take this a few steps further by allowing the character to aim in a direction and play a shooting animation in that direction and (or) allow the character to play a shooting animation while moving in a direction or crouching by layering animations over the existing animations. Or, you can take a look at Skeletal Mesh Sockets for examples on how to attach a weapon to the character's hands now that they can aim.