Body State

Motion Type

Mesh, HeightField and Plane remain static-only. Do not use a motion-type change to bypass geometry restrictions. Prefer creating the body with its intended motion type; switching an existing body is a validated native operation, not just editing a GML field.

APIContract
JOLT_MOTION_STATIC (0)Immovable geometry; not force-driven.
JOLT_MOTION_KINEMATIC (1)Application-driven motion that interacts through velocity with Dynamic bodies.
JOLT_MOTION_DYNAMIC (2)Mass, gravity, contacts, forces and impulses drive motion.
body.set_motion_type(motion) / get_motion_type()Requests or reads the native motion type. The setter can reject unsupported transitions.
GML
if (!body.set_motion_type(JOLT_MOTION_KINEMATIC)) {
    show_debug_message(jolt_get_error_message());
}

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
JoltBody.get_motion_typeJoltBody.get_motion_type()JOLT_MOTION_STATIC/KINEMATIC/DYNAMIC; setter Boolean, getter enum or undefined. Native rejects unsupported changes/geometry; wrapper updates motion_type only after success.
JoltBody.set_motion_typeJoltBody.set_motion_type(motion_type)JOLT_MOTION_STATIC/KINEMATIC/DYNAMIC; setter Boolean, getter enum or undefined. Native rejects unsupported changes/geometry; wrapper updates motion_type only after success.