Body State

Local-space Forces

Only the application point is local. The helper rotates (lx,ly,lz) by the body's current quaternion and adds its world position. Force (fx,fy,fz) and impulse (ix,iy,iz) remain WORLD-SPACE vectors. It does not rotate the direction for you.

GML
body.add_force_local(fx, fy, fz, lx, ly, lz)
body.add_impulse_local(ix, iy, iz, lx, ly, lz)
GML
// Push in world +Z at a point one unit along the body's local X.
if (!body.add_force_local(0, 0, 20, 1, 0, 0)) {
    show_debug_message(jolt_get_error_message());
}

Force acts during simulation and is appropriate for a sustained push; an impulse is a one-time momentum change. Do not apply a one-shot impulse every frame. If you want a body-local thrust direction, rotate that direction into world space yourself before calling the helper.

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
JoltBody.add_force_localJoltBody.add_force_local(fx, fy, fz, lx, ly, lz)Boolean; Dynamic body, world XYZ force in N. Without a point acts at COM; at_position uses world m, local converts only the local point in m, not force direction. Refresh force for each desired physics step.
JoltBody.add_impulse_localJoltBody.add_impulse_local(ix, iy, iz, lx, ly, lz)Boolean; Dynamic body, one-shot world XYZ impulse in N·s. at_position world point, local only the point relative to origin; impulse vector stays world-space.