Add Health Bar for Placeholder Information

This commit is contained in:
Philip W 2023-11-09 12:53:33 +00:00
parent f56aece550
commit dac2f1f708
5 changed files with 15 additions and 6 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -198,8 +198,14 @@ float AEndlessVendettaCharacter::TakeDamage(const float DamageAmount, FDamageEve
if (CurrentHealth <= 0) if (CurrentHealth <= 0)
{ {
CurrentHealth = 0; CurrentHealth = 0;
if (!GetWorld()->GetTimerManager().IsTimerActive(RegenHealthTimerHandle))
{
GetWorld()->GetTimerManager().ClearTimer(RegenHealthTimerHandle);
}
UE_LOG(LogTemp, Warning, TEXT("Player is dead")); UE_LOG(LogTemp, Warning, TEXT("Player is dead"));
UGameplayStatics::OpenLevel(this, FName(*GetWorld()->GetName()), false); UGameplayStatics::OpenLevel(this, FName(*GetWorld()->GetName()), false);
return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
} }
if (!GetWorld()->GetTimerManager().IsTimerActive(RegenHealthTimerHandle)) if (!GetWorld()->GetTimerManager().IsTimerActive(RegenHealthTimerHandle))
{ {