I move left and back, and it seems to work fine. But then when I move right and forward, I fly to the left… keyboard movement is fine but gamepad is the problem.
This line is in Tick of my player character:
AddMovementInput(GetActorForwardVector() * MovementVector.Y + GetActorRightVector() * MovementVector.X, 1);
And this is in SetupPlayerInputComponent:
InputComponent->BindAxis("Forward", this, &AMyPlayerCharacter::MoveForward);
InputComponent->BindAxis("Right", this, &AMyPlayerCharacter::MoveRight);
InputComponent->BindAxis("Mouse Y", this, &AMyPlayerCharacter::Look);
InputComponent->BindAxis("Mouse X", this, &AMyPlayerCharacter::Turn);
InputComponent->BindAction("Shoot", IE_Pressed, this, &AMyPlayerCharacter::Shoot);
InputComponent->BindAction("Shoot", IE_Released, this, &AMyPlayerCharacter::ShootRelease);
And my functions:
void AMyPlayerCharacter::MoveForward(float AxisValue)
{
MovementVector.Y = AxisValue;
}
void AMyPlayerCharacter::MoveRight(float AxisValue)
{
MovementVector.X = AxisValue;
}
void AMyPlayerCharacter::Look(float AxisValue)
{
MouseVector.Y = AxisValue;
}
void AMyPlayerCharacter::Turn(float AxisValue)
{
MouseVector.X = AxisValue;
}
And finally, my input settings.
I hope this can be resolved and I thank everyone in the community for their time!