trace#
line#
Traces a line and returns the trace data
trace_result_t line(<vec3_t> start, <vec3_t> end, [optional] <entity_t> ignore_entity, [optional] <int> trace_mask = MASK_SOLID)
| Fields | Description |
|---|---|
startvec3_t |
trace start |
endvec3_t |
trace end |
ignore_entityentity_t |
[optional] entity to skip |
trace_maskint |
[optional] trace mask or MASK_SOLID |
Example
local trace_result = trace.line(from, to, local_player)
if(trace_result.entity ~= nil) then
print("hit:",trace_result.entity:get_name())
end
hull#
Performs a hull trace and returns the trace data
trace_result_t hull(<vec3_t> start, <vec3_t> end, <vec3_t> hull_mins, <vec3_t> hull_maxs, [optional] <entity_t> ignore_entity, [optional] <int> trace_mask = MASK_SOLID)
| Fields | Description |
|---|---|
startvec3_t |
trace start |
endvec3_t |
trace end |
hull_minsvec3_t |
trace hull minimum |
hull_maxsvec3_t |
trace hull maximum |
ignore_entityentity_t |
[optional] entity to skip |
trace_maskint |
[optional] trace mask or MASK_SOLID |
Example
local trace_result = trace.hull(from, to, box_mins, box_maxs, local_player)
if(trace_result.entity ~= nil) then
print("hit:",trace_result.entity:get_name())
end
bullet#
Performs a bullet trace (autowall) and returns the bullet data
bullet_data_t bullet(<vec3_t> start, <vec3_t> end, [optional] <entity_t> attacker = local_player, [optional] <entity_t> target)
| Fields | Description |
|---|---|
startvec3_t |
trace start |
endvec3_t |
trace end |
attackerentity_t |
[optional] trace from entity, local_player by default |
targetentity_t |
[optional] trace to entity |