TraceResult
Description
Table structure used as trace result. Default values are when the trace hits nothing.
See util.TraceLine and util.TraceHull.
Members
number Fraction
This indicates the how much of your trace length was used from 0-1 (resultLength/originalLength).
Default: 1
number FractionLeftSolid
Given the trace started in a solid enviroment, this will return at what distance the trace left the solid from 0-1. Doesn't work if the trace hit a non-worldspawn entity.
Default: 0
number HitGroup
HITGROUP enum describing what hitgroup the trace hit (not the same as HitBox).
Default: 0
Vector HitNormal
The direction of the surface that was hit as a normal vector (vector with length of 1).
Default: Global.Vector(0, 0, 0)
Vector HitPos
The position the trace stopped. This will be the provided endpos if the trace hit nothing.
string HitTexture
The surface material (not texture) of whatever the trace hit. Will be
**displacement**
if the trace hit a displacement, and **studio**
if it hit a prop.Default: "** empty **"
Vector Normal
The direction of the trace as a normal vector (vector with length of 1).
Equivalent to: ( traceRes.HitPos - traceRes.StartPos ):Normalize()
number SurfaceProps
ID of hit surface property from
scripts/surfaceproperties.txt
.
You can get the name using util.GetSurfacePropName.
Used for CEffectData:SetSurfaceProp.
Default: 0