Blender Physical Controls

Crank

Unlimited rotation around +Z. At zero the arm points runtime +X, Blender −X. The grip is fixed to the arm, not an independently spinning handle.

JoltPhysics Asset Editor 0.31.1 · verified against project sources on 27 September 2026.

Blender setup#

Available since addon 0.20.0; supported by 0.31.1. Add this type under Physical Controls, assign its Key and keep scale 1.

Field / operationMeaning and validation
Geometry and pivotOne rigid compound: box arm and fixed cylinder grip. Arm length is pivot-to-grip-axis distance; arm_size is width Y/depth Z. The grip rises +Z from the arm's top face.
MotionUnlimited rotation around +Z. At zero the arm points runtime +X, Blender −X. The grip is fixed to the arm, not an independently spinning handle.
Initial state and readingMount transform defines the pose and the logical counter starts at zero. Defaults: arm 0.5 m, section 0.08 × 0.08 m, grip radius 0.08 m, length 0.18 m, mass 1 kg.
Limits and capabilitiesUse resistance and periodic detents, with the same runtime rotational API as Hand Wheel. No size field, scalar return target or drive in the asset. The center of mass is computed from both parts.
JSON v3arm_length, arm_size:{width,depth}, handle_radius, handle_length, periodic_detents?

Create from the asset#

The following example assumes loaded asset data, a live machine_body and an authored crank named control_main. Geometry overrides are optional; omit settings to use Blender defaults.

GML
var settings = jolt_asset_control_settings();
settings.set_arm_length(0.5);
settings.set_arm_size(0.08, 0.08);
settings.set_handle_radius(0.08);
settings.set_handle_length(0.18);
settings.set_periodic_detents({count:12});
control = jolt_asset_create_control(asset, "control_main", machine_body, settings);
if (is_undefined(control)) show_debug_message(jolt_get_error_message());
// Step, after the physics update:
if (!is_undefined(control) && control.is_valid()) {
    var angle = control.get_angle();
    var turns = control.get_turns();
    var phase = control.get_phase();
    var speed = control.get_speed();
}

Live behavior#

get_angle() returns cumulative degrees, get_turns() signed completed turns, get_phase() phase 0..1 and get_speed() degrees per second. Use set_resistance, set_locked and set_periodic_detents; false disables periodic detents. Scalar Auto Return and set_target are unsupported for this type.

Simulation, rendering and lifetime#

Use the existing jolt_update() loop, then read the control's physical state. Drive your visual model with control.get_transform() or the existing control rendering API. The asset helper creates the same JoltControl bodies and constraints as the direct factory; it does not render your model or assign gameplay actions. Each creation is independent.

control.destroy() removes the mechanism and preserves its parent. Parent destruction and jolt_stop() clean up attached controls. Use managed lifecycle calls. No additional native bridge change is required by the Blender controls integration; use the matching current GML loader and jolt_asset_controls scripts.