Skylight Glass Breaking Using Chaos Fracturing In UE5

This one was a bit challenging.

The Chaos Fracturing system is very complex and involved, and what you can do with it is virtually endless.

The physics simulation and clustering were hard to dial in to mimic a skylight breaking under pressure allowing the player to fall seamlessly down onto the ground.

The Easy Part:


I took a basic static mesh, and fractured it.
I turned show bone colors off.
Change object type to sleeping (otherwise it will break when you run the game)
(The damage modifiers don’t really matter here since we’ll be breaking this with a Field System Component)
Created a glass material to apply to the mesh.

However when I applied the material to the object that I fractured, we could see the pre-fractured points even though it hasn’t been broken yet:

So I grabbed a solid static mesh and used it as the main skylight. The dimensions are exactly the same as my ‘broken’ skylight collection above. The broken skylight object is hidden by default.

When the player collides with our Field System, I simply hide the solid mesh, unhide the broken mesh, and trigger an activate on our Field System.

The Challenging Part:


Create a blueprint class with the type Field System Master.
Change the field fall off shape to be a box.
Change activation type to trigger
Set the field active to false
We need to make sure generate overlap events is on.
Set collision presets to Trigger

(I couldn’t get this working until I did this minor, un-intuitive thing)
Open the Field blueprint you made, go specifically into your Box Volume object, and change it’s collision preset to Trigger. You now should be able to call On Overlap in the main blueprints event graph.

This wasn’t that hard, but it took a bit of tinkering just to be able to call an overlap event.
Lastly, place the field so it’s overlapping the skylight. This field interacts with anything overlapping it.
In the end we have something like this:

As for actually exploding the glass, it should be straight forward. I put my entire collection in one blueprint so I can just drag them into my game as I need them, so showing you the blueprints wouldn’t make sense.

  1. Call the field’s on overlap, cast to your character bp if necessary (it’s not for my use)
  2. Hide the skylight static mesh
  3. Show the broken glass object
  4. Activate the field with this blueprint:

Finally, play a cool glass shattering sound with the Play Sound at Location node.

Adjustments


If you try to play right now, you’ll notice weird things happen when we try to fall through the glass. This can mainly be solved by setting the collision on the broken glass object to ignore pawn only.

You’ll also want to set the character step-up variable to false so we’re not trying to climb up broken glass shards and tripping over them.

I also learned the hard way that if you scale your fractured object in any way after it’s been fractured, it’s going to severely effect how it performs.
My glass was floating in air and becoming weird projectiles when I tried scaling my skylight down.

Adjust the Field System to change how you want your glass to break, play with the mass, damage, and clusters of the fractured item to dial in how you want it.

~Cody

Leave a Reply

Your email address will not be published. Required fields are marked *