Example #1
0
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;
}
Example #3
0
bool ACharacter::IsJumpProvidingForce() const
{
    return (bPressedJump && JumpKeyHoldTime > 0.0f && JumpKeyHoldTime < GetJumpMaxHoldTime());
}
Example #4
0
bool ACharacter::CanJumpInternal_Implementation() const
{
    const bool bCanHoldToJumpHigher = (GetJumpMaxHoldTime() > 0.0f) && IsJumpProvidingForce();

    return !bIsCrouched && CharacterMovement && (CharacterMovement->IsMovingOnGround() || bCanHoldToJumpHigher) && CharacterMovement->IsJumpAllowed() && !CharacterMovement->bWantsToCrouch;
}
Example #5
0
//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();
}