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,
|
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
|
||||||
GetController(), this);
|
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>();
|
auto staticMeshComponent = Hit.GetActor()->GetComponentByClass<UStaticMeshComponent>();
|
||||||
|
|
|
@ -407,6 +407,18 @@ void APlayerCharacter::ProcessHits(TArray<FHitResult> hits, FVector dir)
|
||||||
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
|
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
|
||||||
GetController(), this);
|
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())
|
if (!healthComponent->GetIsDead())
|
||||||
{
|
{
|
||||||
OnEnemyHit.ExecuteIfBound();
|
OnEnemyHit.ExecuteIfBound();
|
||||||
|
|
Loading…
Reference in New Issue