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#
| Item | Meaning / default |
|---|---|
| Button | Short press; 0..1 plus separate is_pressed() hysteresis. |
| Lever / Pedal / Knob | Limited rotation; lever, pedal or rotary knob, value 0..1. |
| Slider / Pull Handle | Linear travel; slider inward along −Z or pull handle outward along +Z, value 0..1. |
| Joystick | Two-axis tilt in a circular range; X/Y −1..1. |
| Wheel / Crank | Unlimited rotation, turn count, phase, speed and four drive modes. |
Reading path#
| Item | Meaning / default |
|---|---|
| 1. Quick Start | Place a working button in the GameMaker loop and handle a press edge. |
| 2. Control type and mounting | Choose geometry, travel, parent and orientation; connect rendering. |
| 3. Shared behaviour | Configure output, return, resistance, locking and detents. |
| 4. Continuous controls | For Wheel/Crank, continue with tracking, detents, motors and their priorities. |
| 5. Reference and diagnostics | Look 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.