Blender and Integrations

Forces / Impulses

Apply force or impulse at an authored point, including its natural torque.

Verified against the project sources on 19 September 2026.

Syntax#

Syntax
jolt_asset_get_force_point(asset, point_ref);
jolt_asset_apply_force(asset, point_ref, body, force);
jolt_asset_apply_impulse(asset, point_ref, body, impulse);
jolt_asset_create_force(asset, point_ref, body);

Factories return undefined on failure; inspect jolt_get_error() immediately. Authoring lookups return independent validated record copies. A reference is a canonical UUID or an exact, case-sensitive Key. Body owners must be live managed bodies in the current world.

World frame = current Body origin transform × authored local transform. The center of mass is not the authoring origin. Positions use metres and rotations use normalized XYZW quaternions. Refresh snapshots as the body moves.

Blender defines where and in which direction; GameMaker defines timing and magnitude. The vector follows local +Z transformed by the point and current owner rotation. Apply calls require a dynamic body and return Boolean. Signed finite magnitudes are accepted; negative reverses direction and zero is allowed. The native body computes torque about its actual center of mass.

Configured force#

GML
// Create: initial strength is zero.
thruster = jolt_asset_create_force(asset, "rear_thruster", body_vehicle);
if (!is_undefined(thruster)) thruster.set_strength(3000);
// Before each intended simulation step:
if (!is_undefined(thruster)) thruster.apply();
// Cleanup when this helper is no longer needed:
// thruster.destroy();
API / fieldContract
force.set_strength(value)Boolean; finite signed force, initially 0. Invalid input leaves it unchanged.
force.get_strength() / force.get_transform()Current strength / current world frame.
force.apply()Boolean; explicitly apply once. Creation and setters do not apply force.
force.is_valid() / force.destroy()Validity / remove helper and its debug registration.

Timing and debug#

Force accumulates for the next native step and is then cleared. One call before jolt_update() does not sustain force across every fixed substep of a multi-step update. Impulse changes velocity immediately once. Configured force objects do not add a continuous-force manager. Owner destruction and jolt_stop() invalidate registered helpers.

GML
jolt_debug_enable(true);
jolt_debug_set(JOLT_DEBUG_FORCES, true);

The debug arrow is 0.5 m long and represents direction, not magnitude. Negative strength reverses it; zero shows +Z. Successful nonzero apply highlights it for 120 ms. The highlight never extends the physical effect.

Verified operation contracts#

These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.

Symbol / ownerSignatureOperation contract
AssetForce.applyAssetForce.apply()Boolean; applies strength N now at the world point resolved from current owner; not a permanently enabled force.
AssetForce.destroyAssetForce.destroy()Returns true, invalidates helper and unregisters debug; does not destroy owner.
AssetForce.get_strengthAssetForce.get_strength()Signed finite N, default 0; setter Boolean, getter stored number without revalidating owner. Negative reverses +Z.
AssetForce.get_transformAssetForce.get_transform()Current world {position, rotation} of the point, undefined on error.
AssetForce.is_validAssetForce.is_valid()Boolean helper and owner validity.
AssetForce.set_strengthAssetForce.set_strength(value)Signed finite N, default 0; setter Boolean, getter stored number without revalidating owner. Negative reverses +Z.
jolt_asset_apply_forcejolt_asset_apply_force(asset,point_ref,body,force)Boolean; Dynamic owner, signed magnitude N / N·s along Force Point local +Z at its current world position. Refresh force before desired steps; impulse is immediate.
jolt_asset_apply_impulsejolt_asset_apply_impulse(asset,point_ref,body,impulse)Boolean; Dynamic owner, signed magnitude N / N·s along Force Point local +Z at its current world position. Refresh force before desired steps; impulse is immediate.
jolt_asset_create_forcejolt_asset_create_force(asset,point_ref,owner)Returns AssetForce/undefined on a live Dynamic owner. Default strength0, no effect without apply; owner is borrowed.
jolt_asset_get_force_pointjolt_asset_get_force_point(asset,force_point_ref)Asset + exact key or canonical UUID. Revalidates the mutable asset and returns an independent data record, not a physics object; failure undefined and managed error.