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?
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?
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.
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.
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;
}
}
}
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:
The system already does this:
And another 1000 lines of code when you Jump
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.
ok now I understand
Thank you for your time