Different behaviour between OnComponentHit.AddDynamic and EventHit

Hello!

I’m making a space invader and I started by creating the shooting mechanism.
I have Aliens that should be destroyed whent hit by something and Projectile that should be destroyed when they hit something.
I’m making it in C++ so I use for both in BeginPlay OnComponentHit.AddDynamic() with an OnHit function that destroy the object and print a debug.
In game, projectiles do behave correctly, but aliens don’t. They destroy themself after being hit a random amount of hits instead of one just like the projectile. It also seems that the projectile destroy themself just before hitting the alien. If I use the player to hit an Alien then same thing: it destroy itself after a random number of hits.
With-script

However if I’m using on the Alien blueprint EventHit->DestroyActor() then it works perfectly. Projectile seems to touch the Alien and the Alien destroy itself when touched.
With-blueprint

I don’t understand why this is happening and I would like to use my C++ code for the Alien class too.

If you need more informations to help me with that I will gladly give them to you.

I think I resolved my problem.
I didn’t set up the native collider of the static mesh to NoCollision. Projectiles were hitting this native collider and not the component Colldier I added.
OnComponentHit bind an action on the Collider component not on the static mesh one.
In the blueprint graph event EventHit bind an action on the native collider not the component one.
This is why alien where destroyed correctly with EventHit

OnComponentHit can also be used in a blueprint but you first need to get the collider.