{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Event On Hit in Unreal Engine 5 C++UE Docs

The Blueprint Event On Hit maps to the OnComponentHit delegate on UPrimitiveComponent. It fires on a blocking physics collision and requires SetNotifyRigidBodyCollision(true).

Blueprint node & C++ equivalent

Header (.h)
UFUNCTION()
void OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor,
  UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
Bind it (needs Simulate Physics + Notify Rigid Body Collision)
MyMesh->SetNotifyRigidBodyCollision(true);
MyMesh->OnComponentHit.AddDynamic(this, &AMyActor::OnHit);

What does Event On Hit do?

Unlike overlap, On Hit fires for blocking collisions where two simulating bodies physically impact each other. It is the right event for bouncing projectiles, breaking objects, or reacting to a physics body slamming into a wall.

The handler signature includes FVector NormalImpulse, which gives the force of the impact, and const FHitResult& Hit, which carries the impact location, normal, and surface data.

How to use it in C++

Declare a UFUNCTION() handler: OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit). Hit events do not fire by default on simulating bodies, so you must call MyMesh->SetNotifyRigidBodyCollision(true); first.

Then bind with MyMesh->OnComponentHit.AddDynamic(this, &AMyActor::OnHit);. The component also needs Simulate Physics enabled and a blocking collision response against whatever it should hit.

Common mistakes

The most frequent mistake is forgetting SetNotifyRigidBodyCollision(true), which is the C++ equivalent of ticking Notify Rigid Body Collision in the editor. Without it, OnComponentHit stays silent even when bodies clearly collide. Hit also needs a Block response, not Overlap.

Frequently asked questions

Why is OnComponentHit not firing in UE5?+

Hit events require SetNotifyRigidBodyCollision(true), Simulate Physics enabled, and a Block collision response between the components. If any of these is missing, no hit event is generated.

What is the difference between On Hit and On Overlap?+

On Hit fires for blocking physical collisions and provides NormalImpulse and an FHitResult. On Overlap fires when components pass through each other with an Overlap response and provides no impact force.

Related Collision & Overlap nodes

View all Collision & Overlap nodes →