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())
{
OnEnemyHit.ExecuteIfBound();
if (HitMarkerSound)
{
UGameplayStatics::PlaySound2D(GetWorld(), HitMarkerSound);
}
}
}
}

View File

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