Cloth

Collision Layers

Cloth participates in the normal rigid-body layer matrix.

Cloth participates in the normal rigid-body layer matrix.

GML
cloth.set_layer(cloth_layer);
var layer_handle = cloth.get_layer();

Use a valid JoltLayer or its handle. get_layer() returns the native handle. Keep the original layer wrapper for its managed methods. Contacts work with static, dynamic and kinematic rigid bodies when layers permit them.

Cloth-vs-Cloth and self-collision are not supported by this integration. A soft body is not a JoltBody: do not pass it to rigid-only APIs. Soft Body Carry uses its dedicated integration and set_grab_enabled(true).

Verified operation contracts#

These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.

Symbol / ownerSignatureOperation contract
JoltBBMODCloth.get_layerJoltBBMODCloth.get_layer()Numeric layer handle; 0 for an invalid wrapper, not a JoltLayer.
JoltBBMODCloth.set_layerJoltBBMODCloth.set_layer(layer)JoltLayer or numeric handle of an existing layer in this world; Boolean.