Sidescroller Template: Can't figure out jumping

I’m trying to make my first game with Unreal. I figured I’d start simple so I booted up the sidescroller template and figured I’d go from there. I decided to make you jump higher when you hold the button, and found the variable JumpMaxHoldTime.

Whenever I set this variable to a non-zero value, it gets the desired effect, but it also makes the character able to jump infinitely without touching the ground. I’ve tried looking at the ACharacter class it inherits from, but couldn’t find the cause of it. What’s more, when I comment out some of the code in the template’s character class…

void AFitanGameCharacter::TouchStarted (const ETouchIndex::Type FingerIndex, const FVector Location)
{
	// jump on any touch
	//Jump();

}

void AFitanGameCharacter::TouchStopped(const ETouchIndex::Type FingerIndex, const FVector Location)
{
	//StopJumping();
}

The character still jumps normally. I’ve rebuilt, testing with a log statement to make sure the rebuild worked, but the odd behaviours are consistent. From what I can tell there isn’t any instance of a Jump() or StopJumping()

I was hoping someone could explain to me what’s causing this behaviour.

Alright, I figured out how to solve it.

ACharacter::Jump() does not properly check whether the player can jump or not before executing the jump. By including:

virtual void Jump() override;

in the (GameName)Character.h file and then adding a modified jump function in (GameName)Character.cpp file:

void AFitanGameCharacter::Jump()
{
	if (CanJump())
	{
		bPressedJump = true;
		JumpKeyHoldTime = 0.0f;
	}
}

Seems to have fixed the infinite jumping problem and has “holding jump” working as intended.

As for TouchStarted() and TouchStopped(), after reading their parameters I realized they were functions for jumping with a touch screen or similar interface and removed them from my class’s .h and .cpp files.