Utility Scripts · Physical Controls
JoltControl API Reference
A complete index of public JoltControl methods, applicable types and return values.
Create controls with the nine jolt_control_* factories in this category, not directly with new JoltControl(). Each factory has signature (options=undefined) and returns JoltControl or undefined. Public body, constraint, parent and type references support integration; data is a custom gameplay struct. Do not overwrite internal handle, valid or config.
Shared methods#
| Signature | Return |
|---|---|
| is_valid() | bool |
| destroy() | bool |
| get_transform() / get_base_transform() | {position:{x,y,z}, rotation:{x,y,z,w}} | undefined |
| set_locked(enabled) / is_locked() | bool / bool |
| set_resistance(value) / get_resistance() | bool / real | undefined |
| get_value(axis=undefined) | real | undefined; Joystick requires 0 or 1. |
| get_output_value(axis=undefined) | real | undefined; Joystick requires 0 or 1. |
| set_output_range(minimum, maximum, axis=undefined) | bool |
| set_inverted(enabled, axis=undefined) / is_inverted(axis=undefined) | bool / bool |
| get_output_config() | {min,max,inverted} | {x:{min,max,inverted},y:{min,max,inverted}} | undefined |
Limited controls and Joystick#
| Item | Meaning / default |
|---|---|
| set_target(value, y=undefined) | bool; scalar 0..1, or joystick x,y in the disc. |
| set_auto_return(enabled) | bool |
| set_detents(items) / get_detents() | bool / array | undefined |
| get_detent() | index 0..255 or −1 without an active detent. |
| is_pressed() | bool; exists only on Button. |
| get_values() / get_output_values() | {x,y} | undefined; Joystick only. |
Wheel and Crank only#
| Item | Meaning / default |
|---|---|
| get_angle() / get_turns() / get_phase() / get_speed() | real | undefined; ° / whole turns / [0,1) / °/s. |
| set_zero() | bool |
| set_periodic_detents(options) / get_periodic_detents() | bool / {count,max_torque,capture_angle,release_angle,frequency,damping} | false | undefined |
| get_periodic_detent() | {index,angle} | undefined |
| set_absolute_detents(items) / get_absolute_detents() | bool / array | undefined |
| get_absolute_detent() | {index,angle} | undefined |
| set_speed_motor(options) / get_speed_motor() | bool / {enabled,speed,max_torque,active} | undefined |
| set_position_motor(options) / get_position_motor() | bool / {enabled,angle,speed,max_torque,frequency,damping,direction,mode,active,reached,angle_tolerance,speed_tolerance} | undefined |
| set_phase_motor(options) / get_phase_motor() | bool / {enabled,phase,direction,speed,max_torque,frequency,damping,mode,active,reached,angle_tolerance,speed_tolerance,resolved_angle} | undefined |
| set_torque_mode(options) / get_torque_mode() | bool / {enabled,torque,active} | undefined |
Signatures use readable parameter names; the GML implementation uses the same order with an internal _ prefix. Each feature chapter contains detailed options, defaults, examples and validation. Calling a method on an unsupported type does not convert the mechanism and may return INVALID_OPERATION.