Skip to content

trace

start_pos

vector Start position

end_pos

vector Final position

plane

plane Surface normal at impact.

fraction

number Percentage in the range [0.0, 1.0]. How far the trace went before hitting something. 1.0 - didn't hit anything

contents

number Contents on other side of surface hit

disp_flags

number Displacement flags for marking surfaces with data

all_solid

boolean Returns true if the plane is invalid

start_solid

boolean Returns true if the initial point was in a solid area

fraction_left_solid

number Percentage in the range [0.0, 1.0]. How far the trace went before leaving solid. Only valid if we started in solid

surface

surface Surface hit (impact surface).

hitgroup

number 0 - generic, non-zero is specific body part

physics_bone

number Physics bone that was hit by the trace

world_surface_index

number Physics bone that was hit by the trace

entity

entity Entity that was hit by the trace

hitbox

number Box that was hit by the trace


did_hit()

Returns true if there was any kind of impact at all

did_hit_world()

Returns true if the entity points at the world entity

did_hit_non_world()

Returns true if the trace hit something and it wasn't the world

is_visible()

Returns true if the final position is visible