Enhanced Input Mapping

Hi,
I have been experimenting with the Enhanced Input Mapping functions on Unreal Engine 5.4.
My key input does not work at all. I have ‘Action Mapping’ and ‘Mapping Context’ added. I have tried all the ways and methods I could find on Youtube (from older techniques to stuff that is 1-2 years old). This was the latest one I saw on this forum.
I have added a basic ‘Spacebar’ function and it does not print string. ‘Action Mapping’ - have set it at ‘bool’ for now. Tried float too, did not work. ‘Mapping Context’ has ‘Left’ and ‘Right’ keys added. And in the blueprint itself have kept spacebar added too (which also doesn’t work). It’s a player character that I am trying this on. Earlier it was a pawn, which was mentioned online that it has no movement characteristics so moved on from that.
Instead of ‘Get Player Controller’ I have tried ‘Get Controller’ too. Instead of ‘Is Valid’, have tried ‘Enable Input’ too. Have experimented with the priority in Mapping Context set at 0 or 1. The Mapping Context has the context I made selected in it. The Print String works for the event beginplay, but does not work for the key inputs.
What am I doing wrong?

It should be like this :innocent:

In addition to that:

  • Don’t forget to add & assign the input actions your desired keys inside the Input Mapping Context
  • Make sure that your character is set as the default pawn and the player controller auto possesses it

Hiya,
Tried the entire process again. It finally worked so have put the solution here (Worked only after adding Game Mode Base, weird coz - it didn’t work in my older files WITH Game Mode Base. Maybe I did some weird stuff in that). Anyway, have put the entire process here.

First → Started a fresh project with ‘No Starter Content’. Created a level, added directional light and a plane (Just to keep basics)

Second → Created ‘Character’ Blueprint, added a cube.

Third → Added IMC and InputAction (with ‘spacebar’ in bool, no other additions)

Fourth → Changed the ‘W’ key to ‘U’ just in case the default camera movement function did not interfere. The keys did not work.

Fifth → Added more blueprints to check further, input keys did not work UNTIL I put a Game Mode Base

Basic Game Mode Base (Empty) → Default Pawn set is character, and override set on THIS game mode, also added a player start (just coz)


The blueprint that finally worked for me → Both Spacebar (through Input Mapping) + ‘U’ key (directly mapped in blueprints) worked finally!
Note: There is no pawn in this, it’s a controller blueprint, so no conversion of a pawn into a controller through casting.

Thanks!

This has nothing to do with Game Mode, not directly. The input did not work because the character was not possessed. The game mode possessed it for you as soon as you set the default character.

You can possess the character manually, or enable input in actors - something that is disabled by default.