В настройках проекта в инпутах прописать имя события для клавиши Пробел.
В классе навесить бинды.
// Called to bind functionality to input
void AMyCharacterCPP::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &AMyCharacterCPP::Jump);
PlayerInputComponent->BindAction("Jump", IE_Released, this, &AMyCharacterCPP::StopJumping);
}
void AMyCharacterCPP::Jump(){
bTest = true;
ACharacter::Jump();
}
void AMyCharacterCPP::StopJumping(){
bTest = false;
ACharacter::StopJumping();
}