‹›
Utility Scripts · Body Penetration

Tip Placement and Configuration

Place the Tip on the actual front surface and point its axis along the intended insertion direction.

jolt_penetrator_tip(body) prepares an inactive model 2 JoltPenetrator. Set position/axis with set_local_position/set_local_axis, then activate with set_enabled(true). The (body, config) overload still creates immediately and retains default model 1. The penetrator must be a Dynamic non-sensor body with a supported solid shape. Supply position and axis in body-local space, not world space; body rotation then transforms them into the world.

GML
tip = jolt_penetrator_tip(penetrator, {
    local_position: { x: 0, y: 0, z: -0.4 },
    local_axis: { x: 0, y: 0, z: -1 },
    capture_model: 2,
    max_angle: 40,
    max_insertion: 0.2,
    mask: 1
});

Core configuration#

NameDefault / rangeMeaning
enabledfalse / legacy config: trueEnables admission for this Tip.
local_position{x:0,y:0,z:0}Finite local point on the collision shape's front surface.
local_axis{x:0,y:0,z:1}Finite nonzero vector. It is normalized; its positive direction means insertion.
mask4294967295 / uint32Allowed target category_bits; at least one bit must overlap.
max_angle20° / 0 ≤ angle < 90°Maximum current angle between the axis and the target's inward normal.
max_insertion0.5 m / > 0Tip insertion limit relative to the entry point.
max_simultaneous_penetrations1 / integer 1–32Maximum simultaneous relationships on one Tip; world capacity also applies.
max_capture_axial_speed0 m/s / ≥ 00 disables this speed cap. A positive value caps relative axial speed at admission, not subsequent movement.
capture_model2 setters / 1 legacy config; 0, 1, 2, 3A newly prepared setter object uses model 2. The config-struct overload retains default model 1. Opt into model 3 with JOLT_PENETRATION_CAPTURE_STRICT_PREDICTIVE.

Capture model 2 parameters#

NameDefault / rangeMeaning
probe_length0.05 m / 0 < x ≤ 1Axis-surface search length. Support geometry can justify a longer ray; this setting does not authorize capture across a larger gap.
probe_radius0 m / 0 ≤ x ≤ 0.1Expands candidate search around the axis. It is not another collider or permission for a side hit.
capture_gap0.001 m / 0 < x ≤ 0.005Maximum positive gap of the leading support in front of the verified surface.
capture_overlap0.02 m / 0 < x ≤ 0.03Maximum initial authored-Tip intrusion measured along the surface normal. This is not the final max_depth.
tip_surface_tolerance0.001 m / 0 < x ≤ 0.002Tolerance for registering the Tip on the front surface.
rearm_separation0.01 m / 0 < x ≤ 1Clearance needed to rearm after extraction; the body is checked as well as the Tip point.
contact_assistedtrueRetained model 1 setting. It does not change model 2 decisions or toggle segmentation or support geometry.
contact_tolerance0.02 m / 0 < x ≤ 0.1Original tolerance; modern models also use an explicitly supplied value as a fallback for probe_length and rearm_separation at creation. Prefer the dedicated parameters.

configure() first loads the full current configuration. Changing contact_tolerance alone therefore does not replace the existing probe_length or rearm_separation. Numbers must be finite; out-of-range values are rejected. Unknown keys are not public settings and have no guaranteed 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
jolt_penetrator_tipjolt_penetrator_tip(body,config=undefined)Live Body; without config returns a pending inactive JoltPenetrator (handle 0), with config activates according to enabled (default true). undefined on failure. Note capture_model defaults differ: builder 2, direct options omitting the field 1. Explicitly select JOLT_PENETRATION_CAPTURE_STRICT_PREDICTIVE (3) for Strict Predictive.