Learning Unreal Engine 5: How to implement Enhanced Input Actions

In Unreal Engine, you can set up keybinds for character actions in various ways. One effective method is leveraging Unreal Engine 5’s Enhanced Input Actions system, ensuring easy remapping across different control schemes. This system replaces Unreal 4’s previous Action Mappings system. In this post we’ll look at the most basic setup needed to get started with Enhanced Input Actions.

The Enhanced Input Actions system has two core concepts: Input Actions and Mapping Contexts:

Input Actions are actions that you want to perform. These are custom defined interactions that you’ll want the user to perform in game. The Input Actions themselves are kind of like Interfaces – they don’t do much by themselves but they help make things clearer.

Mapping Contexts group key bindings for similar actions. These can be set per platform or interaction mode within the game. For example, you may have a default mapping context that holds the key bindings for movement and basic interactions, then a weapon context for weapon specific keybinds, or a vehicle context for vehicle specific keybinds. Additionally, Mapping Contexts allow for contextual keybinds – where the same button does different actions within the same Mapping Context depending on what the player is doing at the time. For example – CTRL triggering a crouch if the character is moving, and triggers a slide if the player is sprinting.

Creating Input Actions

  1. Right click on the content drawer
  2. Go to Input -> Input Actions

When I did this, it was to implement an interact interface I’d set up. So in the Input Action I’d created, I didn’t need to change anything. I’d connect it in later steps.

Adding an Input Action to a Mapping Context

(Optional) Creating a new Mapping Context

  1. Right click on the content drawer.
  2. Go to Input -> Input Mapping Context
  3. Name it IMC_ whatever your mapping context is. By default there is an “IMC_Default” and “IMC_Weapons” contexts.

Add to an Existing Mapping Context

  1. Navigate to the existing Mapping Context (if using default, go to Content -> First person or Third person (whichever is relevant)) -> Input
  2. Open the context (like IMC_Default)
  3. Click + next to Mappings to add a new Action Mapping
  4. Select an Input Action from the dropdown
  5. Expand the mapping, click the keyboard icon and type the desired keybind to set.

Set up the Action

  1. Go to your player controller (BP_FirstPersonCharacter or BP_ThirdPersonCharacter is default if using First or Third person templates)
  2. In the Event Graph, right click and search for “IA” to show the input actions
  3. Select the input action you created. It will appear as “EnhancedInputAction IA_Name”
  4. Hook up the actions as needed!

To read more on Unreal’s Enhanced Input Actions, check out the official docs.