Okay, the things are really easier than I thought)
After all the fixes project compiled but there is no particle effect onhit (as no autodestroy as well)
I’m trying to use the function this way:
void AEnemy::OnCompHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
if (IsValid(OtherActor) && IsValid(OtherComp))
{
UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), DestroyParticleSystem, GetTransform(), true, EPSCPoolMethod::None, false);
AddDeathCount();
// Destroy(); // Destroy self if we hit anything
}
}