Joystick
Circular tilt cone: Max Angle is the angle from neutral, not the full cone opening. Runtime +X points toward Blender local −X; +Y toward Blender local +Y.
JoltPhysics Asset Editor 0.31.1 · verified against project sources on 27 September 2026.
Blender setup#
Available since addon 0.19.0; supported by 0.31.1. Add this type under Physical Controls, assign its Key and keep scale 1.
| Field / operation | Meaning and validation |
|---|---|
| Geometry and pivot | Lower pivot, rod along +Z with Radius and Length. |
| Motion | Circular tilt cone: Max Angle is the angle from neutral, not the full cone opening. Runtime +X points toward Blender local −X; +Y toward Blender local +Y. |
| Initial state and reading | Starts neutral with no Initial Angle. get_values() returns {x,y}; get_value(0) and get_value(1) read individual axes. Return X/Y is a motor target. |
| Limits and capabilities | 0 < Max Angle < 90°. Target and detent positions must lie in the unit disc x*x+y*y ≤ 1. Preview outside the disc is clamped for display; invalid exported targets are rejected. |
| JSON v3 | size:{radius,length}, max_angle, target:{x,y}, detents with x/y |
Create from the asset#
The following example assumes loaded asset data, a live machine_body and an authored joystick named control_main. Geometry overrides are optional; omit settings to use Blender defaults.
var settings = jolt_asset_control_settings();
settings.set_radius(0.06);
settings.set_length(0.60);
settings.set_max_angle(30);
settings.set_auto_return(true);
settings.set_target(0, 0);
settings.set_max_torque(10);
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 tilt = control.get_values();
var value_x = tilt.x;
var value_y = tilt.y;
}Live behavior#
Live set_auto_return, set_target, set_resistance, set_detents and set_locked adjust supported behavior. Auto Return takes priority over detents. Output mapping and inversion are runtime choices. These operations do not rebuild geometry or replace the original construction pose.
control.set_auto_return(false);
control.set_detents([{x:0,y:0}, {x:0.5,y:0}, {x:-0.5,y:0}]);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.