While I was practicing a simple FPS example, I found that the ‘LookUp’ and ‘Jump’ function for the Character have no effect
What I did is:
1.inherit a class from character class
2. did these like below
void ASCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAxis("MoveForward", this, &ASCharacter::MoveForward);
PlayerInputComponent->BindAxis("MoveRight", this, &ASCharacter::MoveRight);
PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput);
PlayerInputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput);
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump);
}
3.bind axis and action like this:
Results:
The character can move and trun, but can’t jump and look up and down,which really confused me.
Is there anyone so kind to help me solve the problem?