Add HitMarker Sound Effect

This commit is contained in:
Louis Hobbs 2023-08-16 12:31:07 +01:00
parent e97d370d23
commit 7079c129f7
2 changed files with 8 additions and 0 deletions

View File

@ -345,6 +345,11 @@ void APlayerCharacter::ProcessHits(TArray<FHitResult> hits)
if (!healthComponent->GetIsDead()) if (!healthComponent->GetIsDead())
{ {
OnEnemyHit.ExecuteIfBound(); OnEnemyHit.ExecuteIfBound();
if (HitMarkerSound)
{
UGameplayStatics::PlaySound2D(GetWorld(), HitMarkerSound);
}
} }
} }
} }

View File

@ -112,6 +112,9 @@ private:
float WeaponSpreadMultiplier = 1.0; float WeaponSpreadMultiplier = 1.0;
UPROPERTY(EditDefaultsOnly)
USoundBase* HitMarkerSound;
public: public:
// Sets default values for this character's properties // Sets default values for this character's properties
APlayerCharacter(); APlayerCharacter();