Download

WASD movement is super slow, but other keys normal

I am trying to throw together my first UE4 test game (FPS) and cannot figure out what is the problem with movement.
I setup the Axis Mappings for MoveForward, MoveRight. W = scale 1.0, S = scale -1.0, etc. I added UP and DOWN as well, and set their scales appropriately.
For some reason, any key that is a letter (ABCDEF…) moves the player suuuuuuuuuuper slow (almost undetectable), but any “special” key like UP or PAGE UP, etc behaves normally for player movement (when mapped to the same axis). I can’t figure out what the difference is - it seems to be something about the keys I chose, but why?? I’m just wanting to use the standard WASD.

Here is the relevant code snippets for MoveForward:


#include "Components/InputComponent.h"
#include "GameFramework/Controller.h"
#include "GameFramework/Pawn.h"
#include "GameFramework/Character.h"
#include "GameFramework/CharacterMovementComponent.h"
...
void AFPSCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
// set up gameplay key bindings
PlayerInputComponent->BindAxis("MoveForward", this, &AFPSCharacter::MoveForward);
...
void AFPSCharacter::MoveForward(float Value)
{
if ((Controller != NULL) && (Value != 0.0f))
{
// find out which way is forward
FRotator Rotation = Controller->GetControlRotation();
// Limit pitch when walking or falling
if (GetCharacterMovement()->IsMovingOnGround() || GetCharacterMovement()->IsFalling())
{
Rotation.Pitch = 0.0f;
}
// add movement in that direction
const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::X);
AddMovementInput(Direction, Value);
}
}