‹›
Shape Resources

Collision Shapes and JoltShape

JoltShape is immutable collision geometry. JoltBody is a simulated object with a transform, motion type and state. Creating a shape alone adds no collision object to the world. Reuse a shape when many bodies have identical geometry.

GML
// After successful jolt_start().
var shape = jolt_shape_box(1, 1, 1);
if (!is_undefined(shape)) {
    var first = shape.create_dynamic(0, 0, 3);
    var second = shape.create_dynamic(2, 0, 3);
    shape.destroy(); // Bodies retain their own native shape references.
    if (is_undefined(first) || is_undefined(second)) {
        show_debug_message("Body creation failed");
    }
}