How does the hit event work?

How does the hit event work?

Hi,
I have read through the official unreal docs on how the overlap & hit works.
Watched a bunch of youtube videos. searched the web.

And still, I don’t understand UE hit event behavior.
Docs show that should I want to trigger a hit event I have to enable “Simulation Generates Hit Events”.
However, as long as my collider is the root of the actor hit also fires if “Simulation Generates Hit Events” is turned off.
Both “On component hit” & “Event Hit” keep firing.

When I make a box collider a child component of an actor Hit event won’t trigger at all. The Player will just move through the object.
Event overlap on the other hand works just as advertised.

So my questions:
1.Why do hit events fire without “Simulation Generates Hit Events” enabled?
2.How come once the collider is a child overlap events work but hit events will not?

Any tips/links would be really appreciated.

All my hit events so far work without the need for “Simulation Generates Hit Events”.
I only run into issues when making the collider a child, like shown in the screenshots.

alt text

1 Like

1.Why do hit events fire without “Simulation Generates Hit Events”
enabled?

It’s about physics simulation. With the setting off, they will still fire if something non-physical happens (a character walks into a wall). If you turn it on, hits generated by physics simulation will also be generated (a box falls to the ground due to gravity, generating dozens of hits events)

If in doubt, hover over the setting and hold Ctrl + Alt to access the extended tooltip.

2.How come once the collider is a child overlap events work but hit
events will not?

Again, it’s in the tooltip:

You want hits, use blocking. You want overlap event, well, use overlap. Although that’s not really an answer here. See below.


When I make a box collider a child
component of an actor Hit event won’t
trigger at all. The Player will just
move through the object. Event overlap
on the other hand works just as
advertised.

A child set to block seems to be working fine on my end. In your case scenario, what is the Enemy Actor’s object type set to?

1 Like

Enemies are set to “Enemy”. Player & Enemy are set to block.
The enemy does detect the collision with the object channel “Environment” (but also only if the collider is the root of the actor. If I use a scene component as root nothing).

Once I make the player’s box collider the root hit event fires. But once I use a scene root component as the root nothing happens. (Not sure if scene component is good practice to use as a general root object?)

Mhh… I kind of already see it coming, using a scene component as root is a no go?

using a scene component as root is a
no go

It’s definitely a bad idea to use it for physics.


Just to clarify:

This generates hits events correctly. All with default settings.

No, made 2 simple actors. one moves towards the other. no-hit event.
Once I put both the actor’s box collider as root everything works again.

alt text