Keyboard input not working properly

I’m having som issues with controlling my top down character using keyboard input. I’ve set up the input like this:

But when I press any of the WASD keys the character starts running in wanted direction but then starts to stutter like this:
If I run diagonally the it’s all fine.
Any suggestions on what I might be doing wrong?

Hello, that should work perfectly fine the way you have it there if you had the camera oriented behind your character… The video you posted is set to private so we can’t view it. I’m assuming it’s because your camera is topdown so when you get the forward vector your PlayerController it’s going to be pointing downwards. A way to test this is to set your camera view pointed straight downwards and your character shouldn’t be able to move at all. What you want is to get the controlled rotation of your PlayerController and get the right and forward vectors from the Yaw rotation.

The only thing you would have to do is zero out the pitch and roll components of the rotation because your MoveForward and MoveRight is only controlling movement along the xy plane (so x and y has to be 0). Then get the Forward and Right vectors from the Z(Yaw) component only and I believe it should solve your problem. Hope it that helps.

(The video is private.)

Thx for your answer :slight_smile: I’ve updated the video so you should be able to view it now. Unfortunately the problem remains when updating the blueprint with the solution. I plugged in a Xbox gamepad and it works like a charm. Is that logic implemented somewhere else by default? Ofc I updated the Engine->Input settings for axis mappings as well for the gamepad.

It should be working now

Try to make a base TPS project, that is pre made, and check if you have any problems with that too. If not, try to reproduce that logic in your game too. I wonder if the stutter still happens.

I can’t really think of this would be happening, when you bring the camera down facing forward for first person view does it do the same lagging movement?

It turned out that my keyboard was causing the problem. I’ve got hotkeys on my mechanical keyboard that affects the number of character printed per second when holding down a key. See picture*. I changed it to the lowest setting and now it works just fine with the solution you provided. So I’ll mark your solution as the answer. I guess the keyboard flooded the OS with input events which some can argue does not have anything to do with UE4. UE4 was however the only software that was affected in a crippling way so hopefully this will help someone else in the future.

1 Like

I use the same model of keyboard as you (magicforce right?) and has been scratching my head over this bug for weeks now. Tks =))