A jointed breakable object is a pre-broken object that uses joints to hold the individual pieces together. As soon as a certain amount of force (defined in the joints UDP Settings) is applied to the joint it will break the connection between the pieces and spawn a particle effect defined in the surface type of the proxy. A jointed breakable is a complex object that has a big impact on performance regarding drawcalls, memory impact and physics calculations. Whenever building one, be smart and use as few pieces you can get away with. Besides just breaking parts off of your model, you can also make pieces disappear or spawn one or several new pieces when the joint gets broken.
This section will get you prepared for setting up various breakables within Maya and exporting them into Sandbox. You can access it by clicking on Maya Breakable Object Tutorial.
Enable p_draw_helpers 1 and p_debug_joints 1 in the console.
Joints connected to the world will be displayed in red. Joints interconnecting two pieces will be displayed in light grey. The "spikes" on the joint objects show the orientation. For consistent results, they should point into the z-Axis (up).
When a force is applied to a joint, the direction is shown (in this case shift and bend), together with the strength and the limit of the particular joint. Green text represents an impact with an impulse much lower then the joint limit. Yellow represents values closer to the joint limit. Red represents values which were higher than the limit - in this case the joint is broken.
The mass of your pieces will be displayed in blue, centered on the piece.
To check for drawcalls and statobjmerging, enable r_stats 6 and e_debug_draw 1.
If statobjmerging does work, your entire object will be displayed in a yellow or orange frame with a low number of drawcalls.
If statobjmerging doesn't work, the individual pieces will be displayed in a blue frame with a high number of drawcalls. Statobjmerging must always work on your object.
Q: The joints do not show up.
A: Check naming convention ($joint01, $joint02,...). Check if they have transformations on them. If so, recreate them and reposition them.
Q: My object does not break when shot.
A: Check that the weapon you are using is strong enough by enabling p_draw_helpers 1 and p_debug_joints 1. If not, lower the joint limit in the UDP Settings.
Q: My object breaks but random pieces disappear.
A: One of your joints is intersecting with more then two pieces of collision geometry. One of your pieces is missing a joint. Check that all pieces have a mass value and all joints have a limit value (or any other from the Joint Properties section). Check that your joints are big enough and intersecting with at least one piece of collision geometry.
Q: My objects jitter when shot.
A: There is not enough space in between your collision geometry pieces.
Q: After the pieces have been shot, they disappear.
A: This is the default behavior to save on physics calculations. If you need your pieces to not disappear, add "entity" to their UDP Settings.
Q: Statobjmerging does not work on my jointed breakable.
A: Check that all surfacetypes in your material are set to non breakable ones (especially check for glass and wood surfacetypes). If you need breakable glass, separate the glass into its own cgf and create a new material for it. Check for the polycount on your base object - If it is higher then 3000, separate the breakable pieces into their own cgf files. (refer to Restrictions).
Q: One of the pieces remains floating after I shoot the model into its separate parts.
A: The model needs a grounded piece. Place a joint on a part of the model where it will be touching the terrain, to 'ground' the model.