‹›
Utility Scripts · Body Penetration

Multiple Tips and Targets

One tool can have several Tips and one Tip can have several simultaneous targets.

Each Tip has separate enabled, mask and capacity settings. Each relationship belongs to exactly one Tip and one target. Existing channels on the same penetrator must have compatible directions; multiple Tips do not automatically allow independent axes.

Multiple targets on one Tip#

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_simultaneous_penetrations: 3,
    max_insertion: 0.6
});

// Read every connection, not just the first one.
var relationships = tip.get_relationships();
for (var i = 0; i < array_length(relationships); ++i) {
    var snapshot = relationships[i].get_snapshot();
    if (is_struct(snapshot)) {
        show_debug_message(string(snapshot.target_handle) + ": " + string(snapshot.depth));
    }
}

Register and position every target separately. Each connection has its own entry point, resistance and effective max_depth. Resistance from multiple targets acts together. Raising capacity alone does not guarantee passage through the first target or sufficient tool length.

Two tips on one front face#

GML
var fork = jolt_box_create_dynamic(0, 0, 1.6, 0.10, 0.10, 0.80, { mass: 1 });
var tips = [];
for (var side = -1; side <= 1; side += 2) {
    array_push(tips, jolt_penetrator_tip(fork, {
        local_position: { x: side * 0.03, y: 0, z: -0.4 },
        local_axis: { x: 0, y: 0, z: -1 },
        capture_model: 2
    }));
}

Check each returned Tip with is_struct. Two points on a solid Box face demonstrate multiple logical tips; they do not cut a fork shape into the collider. Collision geometry must match your intended tool and supported shapes.

Category filtering#

GML
// Keep the other material settings in your own full configuration.
jolt_penetration_target(wood, { category_bits: 1, forward_force: 5, backward_force: 10 });
jolt_penetration_target(foam, { category_bits: 2, forward_force: 1, backward_force: 2 });

// Configure only while the Tip is free and not rearming.
tip.configure({ mask: 1 | 2 });

Category masks apply in addition to collision-layer and group filters. Penetration does not override your collision policy when a pair cannot normally collide. An empty mask intersection returns MaskMismatch. IncompatibleChannel means an incompatible axis; IncompatibleConstraint means a conflict with an existing user constraint on the penetrator.