Skip to main content
Version: Next (dev)

Character Cloth and Bone Chains Components

Both components come with the plasma.jolt package and are found under Physics > Jolt > Animation in the Add Component menu. Both go on the same object as the character's Animated Mesh component and run after the animation pose of the frame is known.

Character Cloth (Jolt) component​

The Character Cloth (Jolt) component simulates the garments described by a cloth asset. Every point of a garment may move up to its painted max distance away from where skinning puts it, so the cloth stays with the character whatever the animation does. The result is handed to the mesh, which draws the garment with the simulated positions.

When you save a cloth asset, the editor offers to add this component wherever the mesh is used without it.

Properties​

PropertyDefaultDescription
ClothThe cloth asset to simulate. It must have been made for the mesh of the Animated Mesh component on this object.
SimulateonOff leaves the garment skinned. Switching it fades the cloth in or out instead of popping.
ImportanceNormalLow, Normal, High or Always Simulate. When more garments want to simulate than the budget allows, higher importance wins, then the nearer garment. Always Simulate is never reduced and does not count against the budget: use it for the player's garments.
MaxDistanceScale1Scales every point's max distance (0 to 4). 0 hands the garment back to animation, for example in a cutscene or a finisher.
WindInfluence1How strongly wind moves the cloth (0 to 10).
LinearInertia0.7How much of the character's linear acceleration reaches the cloth. Lower values make the cloth follow the character more rigidly.
AngularInertia0.7The same for turning.
GravityFactor1Scales gravity on top of the asset's setting.
WorldCollisionAs Set in the AssetOverrides what the garment collides with in the world: As Set in the Asset, Off, Static Geometry, or Static and Dynamic.
CollisionLayer0The collision layer used for world collision.
TeleportDistance2A move further than this many metres in one frame counts as a teleport.
TeleportModeResetWhat a teleport does: Reset snaps the cloth to the skinned pose and drops its velocity; Keep Shape moves the cloth with the character and keeps its shape and velocity.

Script functions​

FunctionDescription
Reset()Snaps the cloth to the skinned pose on the next step. Call it after a camera cut so that no settling shows.
SetSimulate(bSimulate, BlendTime)Switches simulation on or off, fading over the given time.
SetMaxDistanceScale(fScale, BlendTime)Changes the max distance scale over the given time.
SetWindInfluence(fInfluence)Changes the wind influence.

Garment states​

Each frame a garment is in one of these states. Project > Packages > Jolt > Cloth View > State (or Jolt.Cloth.View 6) draws it over every garment in the scene, and Cost (Jolt.Cloth.View 7) shows what each garment costs.

StateColourMeaning
SkinnedGreyNot simulated: beyond the asset's Simulate Distance, off screen, out of budget, Simulate off, or Jolt.Cloth.Enable off.
BlendingBlueSimulated while the max distance fades in or out.
ReducedAmberSimulated at half rate, beyond the asset's Full Rate Distance.
FullGreenSimulated every frame.
InactiveDark greyNo cloth data or no pose yet, or the graphics device cannot draw simulated cloth.

Budgets per quality tier and the other cvars are listed on the Character Cloth page.

Bone Chains (Jolt) component​

The Bone Chains (Jolt) component lets chains of joints swing on top of the animation: a ponytail, a strap, a pouch, a tail. Each chain starts at a named joint and runs along its first child to the last joint. The chains lag behind the character's movement, hang under gravity, follow the wind and stay out of the skeleton's shapes, and the bones keep their length. A chain costs a few microseconds, so the component also suits details that are too small or too far away for simulated cloth.

PropertyDefaultDescription
ChainsThe first joint of every chain.
Stiffness0.250 hangs freely, 1 holds the animated pose.
Damping0.15How quickly the swinging dies down.
GravityFactor1Scales gravity.
LinearInertia0.8How much of the character's movement leaves the chains behind.
WindInfluence1How strongly wind moves the chains.
MaxAngle60°How far a bone may bend away from its animated direction.
CollideWithBodyonCollide with the skeleton's shapes.
Radius0.03How far, in metres, the joints stay away from the body's shapes.
TeleportDistance2A move further than this many metres in one frame counts as a teleport and puts the chains back on the pose.
StandInForClothoffThe chains swing only while the Character Cloth component on the same object is not simulating: far away, off screen or out of budget. For a garment that is skinned to joints of its own.

Reset() puts the chains back on the animated pose; call it after a camera cut. Jolt.BoneChain.Visualize draws the simulated chains.

Bone chains as a cloth stand-in​

A garment skinned to a few joints of its own (for example cape joints down the back) can be animated two ways: near the camera the Character Cloth component simulates it, further away a Bone Chains component with Stand In For Cloth swings those joints for a fraction of the cost. Put both components on the same object, name the garment's first joints in Chains, and enable Stand In For Cloth.

See Also​