void ACharacter::ClearJumpInput() { // Don't disable bPressedJump right away if it's still held if (bPressedJump && (JumpKeyHoldTime >= GetJumpMaxHoldTime())) { bPressedJump = false; } }
bool ASideScrollerCharacter::CanJumpInternal_Implementation() const { const bool bCanHoldToJumpHigher = (GetJumpMaxHoldTime() > 0.0f) && IsJumpProvidingForce(); //return true; const bool canJump = !bIsCrouched && CharacterMovement && (CharacterMovement->IsMovingOnGround() || bCanHoldToJumpHigher || bIsClimbing) && CharacterMovement->IsJumpAllowed() && !CharacterMovement->bWantsToCrouch; UE_LOG(LogTemp, Warning, TEXT("CanJump: %s"), canJump?TEXT("TRUE"):TEXT("FALSE")); return canJump; }
bool ACharacter::IsJumpProvidingForce() const { return (bPressedJump && JumpKeyHoldTime > 0.0f && JumpKeyHoldTime < GetJumpMaxHoldTime()); }
bool ACharacter::CanJumpInternal_Implementation() const { const bool bCanHoldToJumpHigher = (GetJumpMaxHoldTime() > 0.0f) && IsJumpProvidingForce(); return !bIsCrouched && CharacterMovement && (CharacterMovement->IsMovingOnGround() || bCanHoldToJumpHigher) && CharacterMovement->IsJumpAllowed() && !CharacterMovement->bWantsToCrouch; }
//Custom override that removes the "crouched" checks. bool ANimModCharacter::CanJumpInternal_Implementation() const { const bool bCanHoldToJumpHigher = (GetJumpMaxHoldTime() > 0.0f) && IsJumpProvidingForce(); return CharacterMovement && (CharacterMovement->IsMovingOnGround() || bCanHoldToJumpHigher) && CharacterMovement->IsJumpAllowed(); }