Spawn ParticleSystem OnHit NakatomiCharacter
This commit is contained in:
parent
e1ae4f60a8
commit
ed3747037c
|
@ -144,6 +144,18 @@ void AEnemyCharacter::ProcessHits(TArray<FHitResult> hits, FVector dir)
|
|||
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
|
||||
GetController(), this);
|
||||
}
|
||||
|
||||
auto character = Cast<ANakatomiCharacter>(Hit.GetActor());
|
||||
|
||||
if (character && character->GetOnDamagedHitNiagaraSystem())
|
||||
{
|
||||
UNiagaraFunctionLibrary::SpawnSystemAtLocation(this,
|
||||
character->GetOnDamagedHitNiagaraSystem(),
|
||||
Hit.ImpactPoint,
|
||||
dir.MirrorByVector(Hit.ImpactNormal).Rotation(),
|
||||
FVector(1),
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
auto staticMeshComponent = Hit.GetActor()->GetComponentByClass<UStaticMeshComponent>();
|
||||
|
|
|
@ -406,6 +406,18 @@ void APlayerCharacter::ProcessHits(TArray<FHitResult> hits, FVector dir)
|
|||
{
|
||||
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
|
||||
GetController(), this);
|
||||
|
||||
auto character = Cast<ANakatomiCharacter>(Hit.GetActor());
|
||||
|
||||
if (character && character->GetOnDamagedHitNiagaraSystem())
|
||||
{
|
||||
UNiagaraFunctionLibrary::SpawnSystemAtLocation(this,
|
||||
character->GetOnDamagedHitNiagaraSystem(),
|
||||
Hit.ImpactPoint,
|
||||
dir.MirrorByVector(Hit.ImpactNormal).Rotation(),
|
||||
FVector(1),
|
||||
true);
|
||||
}
|
||||
|
||||
if (!healthComponent->GetIsDead())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue