‹›
Utility Scripts · Physical Controls

Overview and Choosing a Control

Physical buttons, levers, pedals and rotary mechanisms for game panels, machinery and interactive objects.

JoltControl combines a dynamic body, a constraint and mechanism management. Values come from actual physical movement. Your project uses them to trigger actions, drive machinery or change settings. A control responds to contact, forces, grabbing and its drive; it does not implement mouse, keyboard or VR hand bindings itself.

Choose a mechanism#

ItemMeaning / default
ButtonShort press; 0..1 plus separate is_pressed() hysteresis.
Lever / Pedal / KnobLimited rotation; lever, pedal or rotary knob, value 0..1.
Slider / Pull HandleLinear travel; slider inward along −Z or pull handle outward along +Z, value 0..1.
JoystickTwo-axis tilt in a circular range; X/Y −1..1.
Wheel / CrankUnlimited rotation, turn count, phase, speed and four drive modes.

Reading path#

ItemMeaning / default
1. Quick StartPlace a working button in the GameMaker loop and handle a press edge.
2. Control type and mountingChoose geometry, travel, parent and orientation; connect rendering.
3. Shared behaviourConfigure output, return, resistance, locking and detents.
4. Continuous controlsFor Wheel/Crank, continue with tracking, detents, motors and their priorities.
5. Reference and diagnosticsLook up signatures, return values and common troubleshooting steps.

Call jolt_start() before creation. Every factory accepts one optional options struct and returns JoltControl, or undefined on error. Common options: parent, position/rotation or local_position/local_rotation, mass, resistance and output. Dimensions are full lengths in metres, mass is in kg; this API uses degrees for angles. See Mounting, Size and Rendering for shared configuration.

Current project integrations#