Created Death Sequence and UI

This commit is contained in:
Rafal Swierczek 2024-03-20 14:33:02 +00:00
parent 031a74352f
commit 3bb50d2ea5
12 changed files with 41 additions and 22 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d51dad89e04472b811ae1150be3e20dc5bd0f8271a0bf74a6f1f844295e8b16f
size 66821

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d8174773472453e8d92eaa8d5984fadd4542bd8e181402aa55ac8d95fbefd032
oid sha256:0cae384479ed9a01ca6f37421b573971efa8e75ec721a9ce461c34d202b15a9d
size 868721

View File

@ -311,19 +311,20 @@ float AEndlessVendettaCharacter::TakeDamage(const float DamageAmount, FDamageEve
{
GetWorld()->GetTimerManager().ClearTimer(RegenHealthTimerHandle);
}
UE_LOG(LogTemp, Warning, TEXT("Player is dead"));
TArray<AActor*> FoundActors;
UGameplayStatics::GetAllActorsWithTag(GetWorld(), FName(TEXT("Respawn")), FoundActors);
if (FoundActors.Num() > 0)
{
const AActor* RespawnPoint = FoundActors[0];
SetActorLocationAndRotation(RespawnPoint->GetActorLocation(), RespawnPoint->GetActorRotation());
CurrentHealth = MaxHealth;
return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
}
UGameplayStatics::OpenLevel(this, FName(*GetWorld()->GetName()), false);
// UE_LOG(LogTemp, Warning, TEXT("Player is dead"));
//
// TArray<AActor*> FoundActors;
// UGameplayStatics::GetAllActorsWithTag(GetWorld(), FName(TEXT("Respawn")), FoundActors);
// if (FoundActors.Num() > 0)
// {
// const AActor* RespawnPoint = FoundActors[0];
// SetActorLocationAndRotation(RespawnPoint->GetActorLocation(), RespawnPoint->GetActorRotation());
// CurrentHealth = MaxHealth;
// return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
// }
//
// UGameplayStatics::OpenLevel(this, FName(*GetWorld()->GetName()), false);
RunDeathSequence();
return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
}
TookDamage.Broadcast();

View File

@ -292,6 +292,9 @@ protected:
UFUNCTION(BlueprintImplementableEvent)
void StoppedHoldingInteract();
UFUNCTION(BlueprintImplementableEvent)
void RunDeathSequence();
// APawn interface
virtual void SetupPlayerInputComponent(UInputComponent* InputComponent) override;
// End of APawn interface