Fracturing & Destruction Help

Creating a fractured object is easy. Here are some quick steps for a normal start:

  • Go to GameObject » Create Other » Ultimate Game Tools » Fractured Object. This will generate a new GameObject that will represent your fractured object. An important thing is that all parameters have a tooltip when you move the mouse on them, so even if there are many you can easily check what they do.
  • Now, on the new GameObject, specify which object you want to use as source for fracturing. It won't be modified so you don't need to back it up, don't worry.
  • Set Start Static if your object won't be attached to the static world and you want it to collapse on the first impact. If your object is going to be attached to the world, which is the most common case, leave it as it is and you will add support planes later.
  • Set the Interior material parameter. This will change the appearance of the interior faces using the material you've selected.
  • Press Compute Chunks, this will generate all chunks. The first time you will be prompted to choose if you want to hide the source object and place the new fractured object on the same position. If you select no, then the fractured object will be created on the current position.
  • Now you can see the chunks using the Preview Chunks slider, voilà!
  • If you want to change the number of chunks, the chunk generation algorithm or any related parameter go to the Fracturing & Interior Material section and regenerate the chunks again.

If the parameter Chunk Interconnection is checked (it is by default) then you may want to add a support plane to attach the object to the world. Normally you will create a plane representing the floor but you can also rotate the plane to attach the object to walls or ceilings. The chunks that are on the -Y side of the plane will be marked in blue, they are the ones that will be fixed to the world and are indestructible, we call them support chunks. All other chunks can be destroyed but will remain attached to the object through the support chunks unless enough force is applied to them.

Support chunks are VERY important because they are the ones that enable intelligent collapsing. If you have a pillar and you destroy it shooting in the middle, you want all the chunks from the middle to the top to collapse too. In this case you create a plane representing the floor and make it intersect the chunks at the bottom to mark them as support.

There are some cases where you don't want an object to be attached to the ground, but rather to the ceiling in the case of a lamp for example. In this case you need to rotate the plane to turn it upside down and move it to the ceiling to mark the top chunks as support. You can create multiple planes with any orientation and size for complex setups.

Now you probably want to edit how the object will be fractured and add visual effects to it. All this is done using the Events section of the panel.

  • The Chunk Detach From Object Due To Physic Collision section enables the object to be fractured when a rigidbody collides with it. You can set the minimum mass and velocity required to detach a chunk from the structure. The Interconnection Strength parameter in the main section plays an important role here, as with lower values you not only will detach the chunk that was hit, but also its neigbours.

    You can also select the sound clip that is played when a chunk was detached and select a prefab list where one random prefab will be chosen and instanced on the collision point. The prefab normally will be a particle system containing an explosion or a dust cloud. Check our sample scenes for use cases.

  • The Free (Detached) Chunks section handles the collision events of chunks that have already been detached from the structure. You can edit the lifetime of chunks to limit the amount of rigidbodies active at the same time and save CPU power.

    Here you can also edit the minimum amount of mass and velocity a chunk needs in order to create a collision event. Like on the previous section, you can edit which sound is played and the prefabs to be instanced with one additional feature: Instead of specifying a single sound clip you can edit a list of clips where a sound clip will be randomly selected and played on each collision. This way we have more natural and random sounds.

  • The When Explode() Is Called Through Scripting (Explosions) section handles the scripting-triggered event when FracturedObject.Explode() is called (see scripting section for more details).

    You can edit the sound that is played when the explosion occurs and also specify a list of prefabs that will be instanced randomly all over the object. This can be used both for explosion particles and dust particles.

  • The When Impact() Is Called Through Scripting (f.e. missiles) section handles the scripting-triggered event when FracturedChunk.Impact() is called (see scripting section for more details).

    You can edit the sound that is played on impact and also the prefab that will be instanced on the collision point (most likely an explosion or a dust particle system).

We recommend to take a look at the samples for actual use cases.

There are many more parameters to play with, here is the complete help reference:

Main

The main fracturing parameters.

Helpmain

Source Object

The object whose mesh will be used as input for the fracturing. It won't be deleted, just used as input typeof(GameObject), true);

Island Generation

Detect isolated meshes when sptting and make them separated chunks (f.e. if you spt a U shape horizontally, it will give 3 objects with island generation (the bottom and the two tips separated), instead of 2 (the bottom on one hand and the two tips as the same object on the other).

Chunk Interconnection

Will generate an internal connection graph between chunks to have structural behavior. This enables intelgent destruction, where it will collapse depending on how the chunks are interconnected and also connected to the world. A tipical example is the sample scene with the arcs and columns, where if you destroy the columns, the chunks that are above will collapse as well. To see how to connect chunks to the world see Support Planes.

Start Static

If Chunk Interconnection is checked and no support planes or support chunks have been defined, an object would collapse on start. Check this if you want the object to stay static until first contact.

Interconnection Min Area

Minimum area between 2 connected chunks to consider them connected. Setting it to zero won't consider all chunks connected, only those that share at least a common face area no matter how small. You can change this value without the need to recompute the chunks.

Interconnection Strength

When a chunk attached to the object is hit and detached, this controls how many connected chunks will detach too. 0.0 will make the whole object collapse, 1.0 won't detach any connected chunks. You can change this value without the need to recompute the chunks.

Support Hor. Strength

Controls the maximum horizontal distance a chunk must be from a support chunk to stay attached to the object. If its distance is greater than this value, it will fall. For example in the arcs and columns sample scene, if you destroy columns that are next to each other, the top part will collapse as well if it is too distant horizontally to the closest column, which contain the support chunks.

Support Is Indestructible

If it is enabled, support chunks can not be destroyed/removed from the object.

Island Max Connect Dist.

When feeding a source object, and Island Generation is active, it may detect multiple closed meshes inside and some of them may be connected to others. This controls how far a face from one island can be from another island to consider the two islands connected.

Total Mass

The total mass of the object. Each chunk mass will be computed depending on its size and this value. You can change this value without the need to recompute the chunks.

Chunk Physic Material

The physic material assigned to each chunk.

Min Colder Volume

Chunks with a volume less than this value will have a box colder instead of a mesh colder to speed up colsions.

Cap Precision Fix (Adv.)

Change this value from 0 only if you experience weird triangles added to the mesh or unexpected crashes! This usually happens on meshes with very thin faces due to floating point errors. A good range is usually 0.001 to 0.02, larger values will introduce small visible variations on some spts. If there's only 2 or 3 problematic faces, then an alternative would be using another random seed.

Reverse Cap Normals

Check this if for some reason the interior faces have reversed ghting.

Fracturing & Interior Material

These parameters control the way the slicing will be performed and the interior material.

Fracture Method

The fracture algorithm. Voronoi generates cellular, more natural looking chunks while BSP slices objects progressively using planes until the target number of chunks is reached. BSP is faster to compute and provides different control.

Voronoi is currently under heavy optimization to work way faster with a high number of cells.

For Voronoi fracturing:

Helpvoronoi

Use Volume Optimization

Will compute fracturing faster when using large meshes or with huge empty volume.

Use Proximity Optimization

Used to speed up Voronoi computation. On some cases it can introduce intersecting chunks, disable it when this occurs.

Use Multithreading

Will use multithreading for some Voronoi computation steps. It isn't fully tested/optimized but it should work. Only disable if you experience any problems."));

Cells In Local X

Voronoi will generate X*Y*Z cells. This is number of cells to generate in the X dimension.

Cells In Local Y

Voronoi will generate X*Y*Z cells. This is number of cells to generate in the Y dimension.

Cells In Local Z

Voronoi will generate X*Y*Z cells. This is number of cells to generate in the Z dimension.

X Cells Variation

Greater values will increase difference in size and positioning of cells in the X dimension.

Y Cells Variation

Greater values will increase difference in size and positioning of cells in the Y dimension.

Z Cells Variation

Greater values will increase difference in size and positioning of cells in the Z dimension.

For BSP fracturing:

Helpbsp

Number Of Chunks

The number of chunks to fracture the mesh into.

Slice In World Space

Controls if the slicing will be performed in local object space or in world space. Note that the original object orientation is considered, not the fractured object.

Slice Regularly

If set, slices will always be performed to minimize the chunk size in all its axes, otherwise they will be performed randomly with the probabilities given.

Slice X Probability

Probability (0-1) that a slice is performed in X.

Slice Y Probability

Probability (0-1) that a slice is performed in Y.

Slice Z Probability

Probability (0-1) that a slice is performed in Z.

Slice Size Variation

0.0 will give chunks more equally sized. Increasing values will give chunks varying more in size.

Slice X Variation

Angular variation for the slices in the X plane.

Slice Y Variation

Angular variation for the slices in the Y plane.

Slice Z Variation

Angular variation for the slices in the Z plane.

Helpmaterial

Interior Material

Material applied to the interior faces of the chunks.

Interior Mapping U Tile

U Tiling of the interior faces mapping.

Interior Mapping V Tile

V Tiling of the interior faces mapping.

Events

These parameters control the behavior of the object on some events.

Helpevents

Chunk Detach From Object Due To Physics Collision

Min Impact Mass

The minimum mass an object needs to have to detach a chunk from this object on impact.

Min Impact Velocity

The minimum velocity an object needs to impact with to detach a chunk from this object.

Exit Force

If a chunk is detached due to an impact, it will have this value applied to it.

Upwards Modifier

Adds an upwards explosion effect to the chunks that have exit force. A value of 0.0 won't add any effect, while 2.0 means it will apply the force from a distance of 2 below the chunk."));

Detach Sound

Will play this sound on the collision point when a chunk is detached due to an impact.

Instance Prefab List (1 Randomly Spawned On Detach)

A list of prefabs. When a chunk is detached due to an impact, a random prefab will be picked from this list and instanced on the collision point. Use this for particles/explosions.

Call Method Name

The method name that will be called on an impact-triggered detach chunk event (see next parameter and scripting reference).

Call GameObject

The GameObject whose method will be called. See the scripting reference.

Free (Detached) Chunks

Min Chunk LifeTime

The minimum lifetime of a free chunk. When the life of a chunk expires it will be deleted.

Max Chunk LifeTime

The maximum lifetime of a free chunk. When the life of a chunk expires it will be deleted.

Offscreen LifeTime

If a free chunk is outside the visible screen for more than this seconds, it will be deleted.

Min Impact Mass

The minimum mass a free chunk need to impact with in order to trigger a collision event.

Min Impact Velocity

The minimum velocity a free chunk need to impact with in order to trigger a collision event.

Max Simult. Sounds

The maximum collision sounds that will be played at the same time.

Collision Sound List (1 Randomly Played On Collision)

A list of sounds. On a free chunk collision a random sound will be picked from this list and played on the collision point.

Max Simult. Prefabs

The maximum number of collision prefabs present at the same time.

Collision Prefab List (1 Randomly Spawned On Collision)

A list of prefabs. On a free chunk collision a random prefab will be picked from this list and instanced on the collision point. Use this for particles/explosions.

Call Method Name

The method name that will be called on a free chunk collision (see next parameter and scripting reference).

Call GameObject

The GameObject whose method will be called. See scripting reference.

When Explode() Is Called Through Scripting (Explosions)

Explosion Sound

The sound that will be played when Explode() is called on this object.

Random Prefabs

The number of prefabs to instance on random positions of the object.

Instance Prefab List (Spawned Randomly Around)

A list of prefabs. When Explode() is called a random number of them will be instanced on random positions of the object. Use this for particles/explosions.

When Impact() Is Called Through Scripting (f.e. Missiles)

Impact Sound

The sound that will be played when Impact() is called on this object.

Impact Prefab List (1 Randomly Spawned On Impact)

A list of prefabs. When Impact() is called a random prefab will be instanced on the impact point. Use this for particles/explosions.

On Every Chunk Detach Event (Collision, Impact, Explosion, User scripted detach...):

Call Method Name

The method name that will be called when a chunk is detached no matter the reason (see next parameter and scripting reference).

Call GameObject

The GameObject whose method will be called. See scripting reference.

Support Planes

Support planes control which chunks are tagged as support. All chunks that are one the negative side (pointed by the plane -Y) and inside its limits will be marked as support.

Chunks that act as support can't be destroyed and will hold the object together. A chunk needs to be connected to a support chunk (directly or through other chunks) or otherwise it will fall. This prevents chunks from staying static in the air and enables realistic collapsing behavior.

Helpsupportplanes

Add Support Plane

Adds a new support plane to this object.

Support plane parameters:

Plane Name

The name that will be shown on the scene view.

Local Position

Plane position with respect to the fractured object.

Local Rotation

Plane rotation with respect to the fractured object. Use this to change the attachment to for example, the ceiling.

Local Scale

Plane scale.

Delete

Deletes this support plane.

Rest of the parameters

Helpremaining

Random Seed

Each seed will create a differently fractured object. Change the seed if you are not happy with the results.

Preview Chunks

Use this slider to preview the chunks that were generated.

Always Gen. Colliders

Will also generate colliders each time the chunks are computed.

Show Chunk Connections

Will draw lines on the scene view to show how chunks are connected between each other.

Color Chunk State

Will color chunks in the scene view to show which ones are support chunks and which ones aren't connected to any support chunks directly or indirectly and will fall down when checking for structure integrity.

Color Chunks

Will color chunks randomly to see them better in the editor window or in the game window (in the game window in play mode only).

Enable Prefab Usage

Will save the chunk and collider meshes to an asset file on disk when they are computed. Use this if you want to add this object to a prefab, otherwise the meshes and colliders won't be instanced properly.

Output Console Info

Outputs messages and warnings to the console window.

Compute Chunks

Computes the fractured chunks.

Delete Chunks

Deletes the fractured chunks.

Use Concave Collider

Use the external Concave Collider utility to have more control over how mesh colliders are generated.

Algorithm

The convex decomposition algorithm. Fast should be the best for 95% of the cases, use the other ones if fast does not work properly.

Max Collider Vertices

Limits the maximum vertices a collider hull can have.

Compute Colliders

Computes the chunk colliders.

Delete Colliders

Deletes the chunk colliders.