Setting Up Inputs

A How To Guide for Setting Up Inputs in Unreal Engine 4.

Choose your operating system:




On this page

After you have imported or created your Character, Vehicle, or Flying Spaceship Asset, you will need to define how it reacts to Player Input. Defining Input is primarily done through user defined Bindings of Action Mappings (which are for key presses and releases) and Axis Mappings (which are for inputs that have a continuous range).

Once you have defined your Mappings, you can then bind them to behaviors in Blueprints or C++.

Implementation Guide

On this page

In this guide, you will create a simple character and set it up to receive input, you will then assign the character to a GameMode so that it is the default pawn during gameplay. If you are familiar with setting up a character or have a character that you want to provide input to (and have a GameMode set up to use your character), you can skip the creating a character section and jump right into creating new inputs and implementing them.

Creating a Simple Character

In this section, we will create a character that we can assign input to (if you already have a Character Blueprint, you can skip this step).

For this example, we are using the Blank project template with Starter Content included.

  1. Inside your project, under Shapes, Right-click on the Shape_NarrowCapsule shape and select Asset Actions - Create Blueprint Using.


    This will be our simple character that we will control.

  2. Inside the Blueprints folder, open the newly created Blueprint, then click File and Reparent Blueprint option.


    We need to change the Class of the Blueprint from an Actor to a Character.

  3. In the pop-up window that appears, select the Character option.

  4. In the upper right of the Blueprint Window, click the Components tab.

  5. On the Components tab under the Components window, click Add Component and add a Spring Arm.


    The Spring Arm component tries to maintain its children at a fixed distance from the parent, but will retract the children if there is a collision, and will spring back when there is no collision. The children in this case will be a Camera so that we have a third person perspective.

  6. With the Spring Arm selected, under Details, search for rotation.

  7. Under Camera Settings, check the Use Pawn Controller Rotation box.


  8. Click the Add Component button again and add a Camera, then drag and drop it onto the Spring Arm component.


    This will make it a child of the Spring Arm.

  9. With the Camera selected, set the Location and Rotation values under Transform to 0.


  10. Select the StaticMesh1 component, then under Details, set the Z value for Location to -90.0.


  11. Compile and Save then close the Blueprint.

Creating a Game Mode to use the Simple Character

Now that we have created a simple character, we need to create a GameMode and tell it to use our new character.

  1. From the Content Browser, click the New Button, then click the Blueprint option.

  2. In the pop-up window that appears, click the Game Mode Button.


  3. Give it a name, then open the GameMode Blueprint and click the Defaults tab.

  4. On the Defaults tab, under the Classes section, click the Default Pawn Class drop-down and select the new character.


  5. Compile and Save then close the Blueprint.

  6. From the Main Editor window, click the Edit Button from the menu bar and select Project Settings.


    We are now going to tell our project to use the newly created GameMode.

  7. In Project Settings, click the Maps & Modes option.

  8. Under Maps & Modes, for Default Modes, click the Default GameMode drop-down and select your GameMode.


Creating New Inputs (Action/Axis Mappings)

The steps below will guide you through adding new Action and Axis Mappings to your project which can then be assigned to your character.

  1. In the Project Settings menu, under Engine, click the Input option.

  2. Under Bindings, click the + signs next to Action Mappings and Axis Mappings to recreate the setup below.


  3. Fill in the empty mappings as seen below.


    Here you are naming each of the mappings and assigning an Input for that mapping. Make sure to set the Scale values to -1.0 where highlighted as the Scale acts as a multiplier on the value of the key when summing up the Axis' value (which allows us to get the opposite direction).

Implementing Action/Axis Mappings in Blueprints

Once you have created Inputs via Project Settings, you can then call those Inputs from within a Blueprint. In this section, we will implement those Input settings for the simple character (or your character if you are using your own).

  1. Inside your project, open the Character Blueprint (Shape_NarrowCapsule) you want to assign Input to.

  2. Inside the Blueprint, Right-click anywhere in the graph and search for Turn then add the Turn Axis Event.


  3. Drag off the Axis Value and search for Yaw, then add the Add Controller Yaw Input node.


  4. Right-click in the graph and add the LookUp Axis Event.

  5. Drag off the Axis Value and search for Pitch, then add the Add Controller Pitch Input node.


  6. Right-click in the graph and add the Jump Axis Event.

  7. Drag off the Pressed pin and search for Jump function.


  8. Right-click in the graph and add the MoveForward Axis Event.


  9. Drag off the Axis Value and add the Add Movement Input node.

  10. Right-click in the graph and add the MoveRight Axis Event.

  11. Drag off the Axis Value and add the Add Movement Input node.


    The events have been added, however we need to specify direction for each still.

  12. Right-click in the graph and search for Get Control Rotation.


  13. Drag off the Return Value and add a Break Rot node (to break the rotation into Pitch, Yaw, and Roll).

  14. Drag off the Yaw pin and add a Make Rot node (to make a rotation out of Pitch, Yaw, and Roll).


  15. Right-click on the Make Rot node and select Break link to Break Rot (Yaw).


    We want to zero out the Pitch and Roll and only keep the Yaw.

  16. Connect the Yaw of the Break Rot to the Yaw of the Make Rot.

  17. Drag off the Return Value of the Make Rot and add a Get Forward Vector and Get Right Vector node.

  18. Connect the Get Forward Vector to the World Direction tied to MoveForward Event.

  19. Connect the Get Right Vector to the World Direction tied to the MoveRight Event.


    The sequence should look similar to above.

  20. Compile and Save, then close the Blueprint.

  21. Play in the editor.

You should now be able to move around in the scene and jump with the capsule character we created (or the character you elected to use).

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey