Skip to content

Commit

Permalink
(wip) add gears-of-war style health indicator to character
Browse files Browse the repository at this point in the history
  • Loading branch information
filfreire committed Sep 16, 2023
1 parent e597032 commit 1b88bb4
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 2 deletions.
Binary file modified Content/Blueprints/PlayerPawn.uasset
Binary file not shown.
Binary file modified Content/Maps/P_TestMap.umap
Binary file not shown.
Binary file added Content/UI/M_HealthIndicator.uasset
Binary file not shown.
Binary file added Content/UI/T_HealthMask.uasset
Binary file not shown.
Binary file added Content/UI/WBP_HealthIndicator.uasset
Binary file not shown.
2 changes: 1 addition & 1 deletion Source/CoopGameFleep/Private/SCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void ASCharacter::StopFire()
}


void ASCharacter::OnHealthChanged(USHealthComponent* HealthComp1, float Health, float HealthDelta, const class UDamageType* DamageType,
void ASCharacter::OnHealthChanged(USHealthComponent* OwningHealthComp, float Health, float HealthDelta, const class UDamageType* DamageType,
class AController* InstigatedBy, AActor* DamageCauser)
{
if (Health <= 0.0f && !bDied)
Expand Down
3 changes: 2 additions & 1 deletion Source/CoopGameFleep/Public/SCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class COOPGAMEFLEEP_API ASCharacter : public ACharacter
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
USpringArmComponent* SpringArmComp;

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
USHealthComponent* HealthComp;

bool bWantsToZoom;
Expand Down Expand Up @@ -72,7 +73,7 @@ class COOPGAMEFLEEP_API ASCharacter : public ACharacter
int RifleAmmo;

UFUNCTION()
void OnHealthChanged(USHealthComponent* HealthComp, float Health, float HealthDelta, const class UDamageType* DamageType, class AController* InstigatedBy, AActor* DamageCauser);
void OnHealthChanged(USHealthComponent* OwningHealthComp, float Health, float HealthDelta, const class UDamageType* DamageType, class AController* InstigatedBy, AActor* DamageCauser);

/* Pawn Died previously */
UPROPERTY(BlueprintReadOnly, Category = "Player")
Expand Down

0 comments on commit 1b88bb4

Please sign in to comment.