Why does my simple Double Jump blueprint not work?

Hello I am trying to do a simple double jump using the blueprint system. I am going to attach what I did:

But it doesn’t work, can you please help me?

There may be no need for script here:

Would this be good enough in this case?

1 Like

Hello, yes your answer makes a lot of sense.

Would it be too difficult to explain why my blueprint doesn’t work? As you can see I am trying to learn and while what I want to accomplish is already done in unreal engine, I thought that if I understand the logic behind it, maybe I can understand blueprints better.

  • did you set the Jump Max Count to 2?
  • what is the default value of Can Double Jump

I did not set the Jump Count to 2. In this case I would like to do it through a blueprint so I can understand how it works better. I understand that it is redundant (but not for learning you see)

the default value of CanDoubleJump starts = true

The Jump function counts jumps. It prevents you from jumping more than what the max is set to. Think of it as of hard limiter - a simplification, so we do not need to script it… Your script seems logical at a glance.

Jump

void ACharacter::CheckJumpInput(float DeltaTime)
{
JumpCurrentCountPreJump = JumpCurrentCount;

if (CharacterMovement)
{
	if (bPressedJump)
	{
		// If this is the first jump and we're already falling,
		// then increment the JumpCount to compensate.
		const bool bFirstJump = JumpCurrentCount == 0;
		if (bFirstJump && CharacterMovement->IsFalling())
		{
			JumpCurrentCount++;
		}

		const bool bDidJump = CanJump() && CharacterMovement->DoJump(bClientUpdating);
		if (bDidJump)
		{
			// Transition from not (actively) jumping to jumping.
			if (!bWasJumping)
			{
				JumpCurrentCount++;
				JumpForceTimeRemaining = GetJumpMaxHoldTime();
				OnJumped();
			}
		}

		bWasJumping = bDidJump;
	}
}

}

1 Like

OK so tell me if I’m correct:

I can’t do a double jump through blueprint logic because it is already a feature of the third person character and it is hard coded.

Is this correct?

Pretty much, yes:

image

The system already does this:

image

And another 1000 lines of code when you Jump :innocent:


What you can do is to set this number higher. And then write your own limiter logic. Set it to 5 and see if your Double Jumping script allows you to jump twice only. Looks like it should.

1 Like

ok now I understand

Thank you for your time