Hi!
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.