Unreal Engine Part 9: Destruction

In chapter 9 of Rob Redman's comprehensive video introduction to Unreal Engine, we look at making simple meshes that can be destroyed through physics interactions...

If there is one thing that all CG artists seem to have in common it's a love of blowing things up, especially using physics simulations, so it's about time I showed you how to do that using Unreal Engine. To keep things clear and simple I will use a simple empty scene preset, so we can avoid worrying about all the props and setups we have created in our main draghorn vale level.

The key to this kind of setup is keeping it simple. While you learn and practice, keep your segment counts low, which will make it easier for you to follow and will also keep your system moving swiftly. That being said, UE4's physics work well and you shouldn't suffer much in the way of lag.

Before we begin, just a note on other interactions. In previous chapters I've shown you different ways of initiating actions, either on contact or at the start of the level. I won't repeat myself here but keep in mind that you could have the destruction sparked by pretty much anything. Maybe an impact from a projectile or even starting the level with your player in the middle of a slowly crumbling building.

Previous tutorials

Part 1: Setting up a new project
Part 2: Introducing materials and landscapes
Part 3: Adding foliage and rocks
Part 4: Particle smoke
Part 5: Introducing the skybox
Part 6: Setting up cameras and post-effects
Part 7: Teleporters

Step 1: Object import

First off we need something to destroy. In this case I've imported an object from CINEMA 4D. You could pre-fracture if you like but actually it's better to do it in UE4, which has some really simple tools to let you define the amount and look of the fragments. Hit the import button in your object browser and locate your mesh, including any textures if needed. I'm using a simple column with a stone type material applied.

I imported this object built in CINEMA 4D

I imported this object built in CINEMA 4D

Step 2: Collision setup

Double-click the column to open it up and you can drag in a default material for it. Once done (I used a sandstone) move to the collision tab and choose a 26DOP collision type. You can choose a different one but this gives a suitable shape.

If you now hit the green collision icon you will see the collision shape highlighted in green. This is all we need to do here so save and close the window to return to the content browser.

The green preview shows the bounding box for the collisions to take place in

The green preview shows the bounding box for the collisions to take place in

Step 3: Editing the destruction settings

This process is all about cuts, so right-click the column and choose Create Destructable Mesh. This opens up a new editor. First up, go to the details tab and make enable impact damage.

Underneath, in the voronoi section, there is a slider where you define the amount of pieces your mesh will split into on destruction. Start off low here, as cranking this too early can cause slow-downs. I'm starting with 50.

Setting the cuts for the actual destruction is a really easy task but is very powerful

Setting the cuts for the actual destruction is a really easy task but is very powerful

Step 4: In the level

Things won't quite work yet but we are almost there. Now you will see a new version of the mesh, called Column_DM in the browser. This was created at the save point of the previous step. Drag this into your level and go to its details.

In the Physics section check the Simulate Physics box and ensure that gravity it turned on.

A few simple options need turning on to get the physics working in the level

A few simple options need turning on to get the physics working in the level

Step 5: Boom!

All that is left now is to build the lighting and start the game, so hit Build/Lighting only then, once that has done, hit play.

You will see that immediately the column starts to crumble. To destroy it more you can shoot the segments and interact with them as a player.

In showing you how to make a destructable mesh here, I'm hoping you will combine that with some of the previous lessons, to create a column that starts off solid and can be destroyed using a trigger event, such as an impact from the ball projectile.

If you'd like a run-down of that too, then please contact me and let me know, along with any other topics you would like me to cover.

A collapsed column is pretty easy to generate and the physics simulation works fast and smoothly

A collapsed column is pretty easy to generate and the physics simulation works fast and smoothly

Next time I'll be showing you how to add other trigger events to support what I've shown so far, from sound effects to impact marks.

Top tip: Inside out

You can see there is a different material showing on the parts of the mesh revealed after it collapses. You can add a different material here by dragging it to the Material 1 slot in the materials section of the column's details. Great for blowing up painted walls with brick or stone underneath.

Related links

Download Unreal
Part 1: Setting up a new project
Part 2: Introducing materials and landscapes
Part 3: Adding foliage and rocks
Part 4: Particle smoke
Part 5: Introducing the skybox
Part 6: Setting up cameras and post-effects
Part 7: Teleporters

Fetching comments...

Post a comment