How-to suggestion for Unreal 5.1


I just figured I’d show one way to do this in Unreal Engine 5.1.

The easiest way is to use the Input mapping Context that we already have in Content/FirstPerson/Input, called IMC_Default for me.

What we want to do first is right-click in the content browser, and click Input Action.


This creates a new Input Action. I call mine IA_Grab. Open it, and set it to have value type Digital (bool). This is the field that was previously differentiated as Action Mapping or Axis Mapping.

Then we can open up the mapping context, press the + next to Mappings, and select our IA_Grab in the dropdown list.

Then we can set the keys for it, same way Sam does!

The input action then exists and works in Blueprints as well:

Started and Completed are like the Pressed and Released. Triggered is issued several times while the button is held down

If you wish, you can instead create your own Input Mapping Context and add all actions you want to that.
You do this by right-clicking and selecting Input Mapping Context. Open it up, press the + next to Mappings, and select our IA_Grab in the dropdown list. It has to be initialised somewhere however, so it’s easier to just add tihns to the existing one.


Thank you! You’re a lifesaver!

I’m on version 5.2. I got to the part where UE said mappings in the Project Settings were deprecated:

I then looked up how to do so in 5.2. This document is useful: Enhanced Input in Unreal Engine | Unreal Engine 5.2 Documentation

I added an Input Action as mentioned above. But then I also added an Input Mapping Context. It’s pretty useless for this project, but I did it to teach myself. Read on if you want to add your own IMC.

It’s been described that a “context” refers to what you’re currently doing. For example, whether you’re walking, or swimming, or driving. In different contexts, the same control might be used to produce different actions.

I believe you start in the context “IMC_Default.” But I decided to add my own context (again, useless for this project). To do so, right-click in your Content Drawer → Input → Input Mapping Context:

input mapping context3

I gave mine the boring name “IMC_Normal”.

Double-click IMC_Normal to open it up. Under Mappings, select IA_Grab, our custom Input Action. Then add the various inputs as usual: keyboard, mouse, etc.

However, the problem is, you start in the IMC_Default context. When the game starts, you need to switch to your new custom context. Following the picture at Enhanced Input in Unreal Engine | Unreal Engine 5.2 Documentation, we edit the BP_Player blueprint to produce the following:

Note that in the “Add Mapping Context” box, we select our custom context “IMC_Normal”.

When you start the game, this code changes BP_Player from IMC_Default to IMC_Normal, and then your controller inputs get properly mapped to the IA_Grab action, which then produces the outputs desired.

1 Like

Privacy & Terms