Solution for OnComponentHit not firing on characters that are not moving

I saw many topics regarding this bug but none gives an actual compromise-free solution. I encountered this bug today and found an easy solution so I’m posting it here.

So you got a character and something hitting it. You use the OnComponentHit event to check for hits on e.g., the capsule component. The problem is, that event only fires when the character moves and does not fire when it stands still, no matter how hard you hit it.

Turns out the origin of the issue is this boolean not being set:

Yep, set that option to true on your character capsule and OnComponentHit will fire even when character is not moving.

Notice that the normal impulse field of the hit, as in this image:

This value seems to always be zero when the hit is generated by character kicking a movable object when navigating to a location. But I assume that’s more or less the desired behavior anyway.

Would there be any particular reason this wouldn’t work even if ‘Simulation Generates Hit Events‘ is ticked?

My player character capsule is set up like so:

Basically I set up the OnComponentHit event to simply print out a message:

If I walk into a wall it registers a hit, but if I get hit by a simple moving platform while standing still it doesn’t register a hit – only if I’m walking into it at the same time. The moving platform BP is set up like so:

¯\_(ツ)_/¯