How to do infinite jumps while key is pressed

Hello!
I’m using UE4 with C++, so the question is - how to keep character jumping while key is pressed? Is there some usefulf variable for that, or i should use something like onlanded event and check if key still pressed for another jump?
Details: i’m using player controller for taking inputs and bind them, then call method “Jump” for possessed character.
Tried to set character->bPressedJump = true; and character->JumpKeyHoldTime = 0.f; with no luck. Googled a few hours, nothing :slight_smile:
Example:

InputComponent->BindAction("Jump", IE_Pressed, this, &AXPlayerController::JumpStart);
InputComponent->BindAction("Jump", IE_Released, this, &AXPlayerController::JumpStop);

void AXPlayerController::JumpStart() {
	if (character) {
		character->Jump();		
	}
}

Hey there!

This is actually quite simple to do.

	//register jump bindings
	InputComponent->BindAction("Jump", IE_Pressed, this, &AMyCharacter::OnStartJump);
	InputComponent->BindAction("Jump", IE_Repeat, this, &AMyCharacter::OnStartJump);
	InputComponent->BindAction("Jump", IE_Released, this, &AMyCharacter::OnStopJump);

As you can see, on the second line you can bind the jump starting function to IE_Repeat as well. This causes it to be repeatedly fired when you hold the key down :slight_smile:

Thanks a lot! It works =)

how do you implement it?

how do i implement it into overwatch?