Skip to content

Hull traces

aqua.trace_hull(from, to, mins, maxs) sweeps an axis-aligned hull with the local player’s native movement collision mask/filter, skipping the local pawn. Each argument is {x,y,z} or {x=,y=,z=}; mins/maxs are relative to the swept origin. All components must be finite and mins must be less than maxs on every axis.

Call from a game-thread callback outside on_draw, then cache results for drawing. Requires a live local pawn and movement/trace bindings. Returns nil, reason when unavailable or the native result is invalid; malformed inputs and wrong callbacks raise.

The result contains hit, solid (engine movement rejection flag), fraction (0..1), startpos, endpos, normal, and optional entity_index/entity_handle for the hit entity. This entity index is the actual hit entity, which can be a pawn or prop.

local sweep, reason = aqua.trace_hull(
{0, 0, 0}, {100, 0, 0}, {-16, -16, 0}, {16, 16, 72})
if sweep then print(sweep.hit, sweep.fraction) end