How can i check if a destructable mesh was destroyed through blueprints

Here’s another way to do this.

The “On Actor Fracture” and “On Component Fracture” nodes are nice, because they fire when and only when the destructible mesh actually shatters, and you can ‘bind’ events to them that do whatever you want to do when the mesh breaks. However, the Blueprint events associated with these nodes only give you the location and direction of the fracture event as outputs to use when calling bound events, NOT a reference to the destructible actor itself. (See image below.)

If each destructible you’re using is its own Blueprint actor, this shouldn’t be a problem – just bind the event to “On Actor / Component Fracture” nodes with that Blueprint itself as the target when you Begin Play:

103640-bindinginownbp.png

If your destructible meshes aren’t blueprints, though, you may need some way to find which mesh shattered when the event fires.

I did that by storing an array of my destructible meshes on “Begin Play” and then binding an event to “On Actor Fracture” for each one that looks for the closest destructible mesh to the fracture location each time the event fires, and tags that mesh as fractured. This seems to work well as long as you don’t have destructible meshes very close together.

(For reasons probably relating to the nature of for loops and actor references, trying to get the Target you’ve bound an event to at the time the event fires always seems to return the last actor to which that event was bound, rather than the actor actually triggering the event.)

Here’s my Begin Play setup for an “Event Controller” blueprint that handles all destructible mesh events…

…and here’s the Macro I wrote to find the nearest actor by to a location from within an array of actor references. This could also be a function if you’re more comfortable with them.