Destroyable objects are structures that contain the original object and pre-created pieces that appear when the original object is destroyed. Its setup is similar to a jointed breakable but it doesn't use any bones. Instead it uses the model in its unbroken state and the pieces in the broken state embedded in one cgf. It can be used to completely destroy specific types of objects in the environment. It shatters into the pre-created pieces by taking more damage then the specified "health" property of the object. It is placed using the DestroyableObject Entity in the engine.
A DestroyableObject can be in two states, an "Alive" or a "Dead" state. In the "Alive" state, it acts exactly like a normal physical entity. It can be set up to be a rigid body or a static physical entity. After taking more damage then the specified "health", it will go into the Dead state. When going into the Dead state, it can optionally generate a physical explosion and apply area damage on the surrounding entities, spawn a particle effect (for example, an explosion), and replace the original geometry of the entity with either destroyed geometry and/or pre-broken pieces of the original geometry. If the object breaks due to a hit (bullet), that hit impulse is applied to the pieces in addition to any explosion (outward) impulse.
Instead of embedding the pieces into one cgf, you can create two different cgf's. One in its undestroyed state, one in its destroyed state.
Place the object as a destroyable Object Entity and specify the cgf's and a health value. It will switch when the object has taken more damage then specified in the health value.
When not specifying anything in the ModelDestroyed tab and not using a cgf that has pieces embedded, the object will disappear when the health is drained.
After you've created your Destroyable object cgf(s), add a particle effect, health values and explosion effects. I've used Props.electrical.aircon_med_a in the example screenshot.
A CGF containing broken object pieces as sub-models must be created for the object. Depending on how you want to set it up, the CGF can also contain the main unbroken model as a separate sub-model. Each sub-model should also have a physics proxy geometry.
The sub-model's name and text properties determine its behavior, as follows:
A plain CGF, with only one sub-model, can also be destroyed. Its model will disappear, but if the model's surface material specifies a destroy effect, it will be spawned. For breakable skinned characters, the CGF should not contain Main or Remain pieces; only "bone" and "generic" pieces.
The setup for making your destroyable object pickable is fairly simple. Refer to the Pickable Objects documentation for more information.
When the object breaks, by default, secondary particle effects are automatically spawned, based on each piece's surface material type. The effects are read from the material script, and there are two kinds of effects that can be specified:
Q: The object doesn't break.
A: Check the health value in your Destroyable object entity. Check your object for correct use of naming conventions (main, remain_xx). Check that every piece has its own collision geometry.
Q: The object spawns no pieces or they get spawned in wrong positions.
A: Set all your pivots on the export helper and reset transformations.
Q: The pieces jitter when broken.
A: The physics geometry pieces intersect with each other. Make sure that there are gaps between the collision.
Please see the Physics Entities document for information on placing a DestroyableObject and their property values.