Tweaked Movement and Jumping Values to feel better

This commit is contained in:
MH261677 2023-11-30 14:52:50 +00:00
parent 39bd245f57
commit 91f9003ff0
2 changed files with 22 additions and 3 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:76a05bba142f49ac64cd4ccb3c1ba1998bb54ba39510c42f8204dd22d3c1fcd2
size 54132
oid sha256:29a9b2fccbf432819ea9a64b75f802f6b121dd5e7a2c34ada69ecf08057f1ace
size 54773

View File

@ -89,6 +89,15 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime)
{
bIsPlayerMoving = false;
}
if (bPressedJump)
{
UE_LOG(LogTemp, Display, TEXT("Player Jumped"));
if(CurrentStamina <= 0.0f)
{
CurrentStamina -= 20.0f;
UE_LOG(LogTemp, Display, TEXT("Current Stam: %f"), CurrentStamina);
}
}
//PLAYER STAMINA HANDLING
if (bIsPlayerSprinting)
{
@ -110,6 +119,16 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime)
}
CurrentStamina += FMath::Clamp(StaminaRegenRate, 0.0f, 100.0f);
}
//make your own jump and call the default character jump
// if (bPressedJump)
// {
// UE_LOG(LogTemp, Display, TEXT("Player Jumped"));
// if(CurrentStamina <= 0.0f)
// {
// CurrentStamina -= 20.0f;
// UE_LOG(LogTemp, Display, TEXT("Current Stam: %f"), CurrentStamina);
// }
// }
}
void AEndlessVendettaCharacter::RegenHealth()
@ -154,7 +173,7 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent*
//Jumping
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ACharacter::Jump);
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &ACharacter::StopJumping);
//Moving
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Move);
EnhancedInputComponent->BindAction(SprintAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::Sprint);