Keyborad doesn't work for axis and action mappings inputs

hello everyone,

I encounter a new problem with Unreal Engine 5.

I want to add new inputs to control the camera in my game, those concerning my mouse work perfectly, but those concerning my keyboard (like W A S D) do not work. I carried out simple tests by just wanting to display a “Hello” with the print function, but even for that no text is displayed on the screen.

anyone have a solution ?

Can you show some BP please?

Of course,

I just made a very simple blueprint to find where the error comes from, but being new to unreal engine 5 I quickly get stuck :

I specify that it’s not the first time that I make inputs on this actor, but before, that concerned only the mouse and worked very well :

And when I click on play, only the events concerning my mouse work :

test

OK… As first… Don’t set axis twice… I mean… No MoveLeft + MoveRight… Just do a MoveH and put two keys inside with the ± values.

Second… Never do values other than ±1. I mean… Never do 100 or -100.
Change them to 1 and -1 and when you call the event, multiply it with a Variable… Best from the GameInstance… That way you can change speeds and values right from the game… Instead if struggling with them in the Input Preferences.

Third.
To your Question:
Do you have Input Events of the same type elsewhere in your Codes? Cause… If yes… And their events consume the input… the inout is gone for all other events… And so… Not fired anymore.
Second idea… Even if the mouse works… Try the EnableInput Node, placed in your Begin play… And connect your Player Controller as Input Caller… That way you make sure the PC is sending Inputs to the Actor, without struggling with the Auto Input Settings…

1 Like

Thanks for the advice, I hadn’t thought of that. :+1:

I did what you told me to do, but it didn’t change anything.

The only other inputs I have are the mouse wheel to be able to zoom in and out in game. After that I also have the “Event BeginPlay” and the “Event Tick” but I don’t think that’s what you’re asking me.

On the other hand, by doing other tests I realized that after the “left mouse button” event was activated once, the inputs concerning my keyboard work correctly. :face_with_raised_eyebrow:

Ah…

That the normal behavior… Now we got the point…
When yoi start your game via play in editor (no matter if in viewport, new pie or standalone), you need to give the new window/viewport focus…
So… You need to click inside it one time to active focus and input handling.

1 Like

ah… ok… i feel kinda dumb for not having thought of that :joy:

Thanks for your answers anyway. :wink: