Problem with destructibles in BP

Hey guys

I created a BP from a destructible using this tutorial: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseOnHit/Blueprints/
The problem is that the hit event doesn’t fire even if I enable “simulation generates hit event” on the destructible. I tried out all possible options that I could come up with, but with no result.
The project is as simple as it could be for now: I only have the destructible and an object that falls on the destructible when the game starts. I did the exact same thing with a static mesh and it worked perfectly.
I’m currently using the 4.13 version.

Is this a bug or am I missing something? Would be cool to here from you :slight_smile:

Cheers,
Daniel

Does the mesh you are using have collision? Go to the mesh and enable the collision view, make sure it is outlined in the preview window, otherwise you can auto-generate a collision. Also make sure that its collision properties allow it to block whatever it is you are wanting to interact with it.

Hey palvand, thx for your reply!

It has collision, because it collides with all the objects in the scene (static meshes and destructibles). Everything already seems to work fine except the fact that it doesn’t trigger a hit event.

Check the Collision Presets and the Enable Impact Damage settings. After these check if the casting is proper. The example shows the casting to the projectile of the weapon. If you are using a different object, you need to cast to your object. So make it a bp and cast it in your script.

Thx for the input, docie!

I recreated the steps in the tutorial but instead of doing the casting and applying damage it just prints a message when the hit event fires. It works when I shoot at it (so the projectile works on it) but when a static mesh with enabled “simulate physics” falls on it, nothing gets fired (although it still collides though). I even created a blueprint with a collision box as root and a static mesh as child but it still didn’t fire the hit event when it collides with the destructible.
I didn’t forget the “simulation generates hit event” flag, although it always works with the projectile, even when it was turned off.

Do someone know why?

I think is a casting failure. The casted bp is the projectile of the weapon. So replace the cast to the projectile with the object (or the parent class of the object) you need to collide with your destructible. Alternatively check your “hitting” mesh for enabled onhit events.

I think we are talking past each other xD

925ed9bc7496a7392b8fa0aa5dce8e66f0a2ffbe.jpeg
This is the only thing the blueprint with the destructible does. And the behaviour is as described in my anterior post. So it only prints “hello” when it gets hit by the projectile and ignores everything else.
And both meshes have the “simulation generates on hit events” on.

Here’s a video showing the problem: The darker box is the blueprint with the destructible. The white one that falls on it is just a static mesh with simulate physics on. When it collides with the destructible it does not generate a hit event. But the projectile does. (I prints now the name of the actor instead of “hello”).

I tried all combinations with “simulation generates hit events” (enabled only on white box, then only on destructible and then on both) but none work with the white box.

I found out what the problem was. The destructible disables hit notifications, if the flag “enable impact damage” is disabled and/or if the mesh already “Broke” to a given support depth, which makes sense when you take a closer look at the source code but is a bit a pain for me, since I want to handle the impact damage on my own (an experimental project for my master thesis). It seems to work if I just reduce the impact damage to the lowest value possible, which isn’t very clean but seems to do the trick for me :slight_smile:

Thanks for your help guys!