TraceResult Structure

From Garry's Mod
Jump to: navigation, search
Table structure used as trace result.



Type Name Description
Entity Entity

The entity hit by the trace

number Fraction

This indicates the how much of your trace length was used from 0-1 (resultLength/originalLength)

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 on entities.

boolean Hit

Indicates whether the trace hit something

number HitBox

The id of the hitbox hit by the trace.

number HitGroup

HITGROUP_ Enums describing what hitgroup the trace hit (not the same as HitBox)

boolean HitNoDraw

Indicates whenever the trace hit a no-draw brush

boolean HitNonWorld

Indicates whenever the trace did not hit the world

Vector HitNormal

The direction of the surface that was hit as a normal/direction vector. ( Vector with length of 1 )

Vector HitPos

Position of the traces hit point

boolean HitSky

Indicates whenever the trace hit the sky

string HitTexture

The surface texture of whatever the trace hit

boolean HitWorld

Indicates whenever the trace hit the world

number MatType

MAT_ Enums of the material hit by the trace

Vector Normal

The direction of the trace as a normal/direction vector. ( Vector with length of 1 )

number PhysicsBone

The physics bone enum hit

Vector StartPos

The origin of the trace

number SurfaceProps

ID of hit surface property, from scripts/surfaceproperties.txt
You can get the name using util.GetSurfacePropName

Used for CEffectData:SetSurfaceProp in "Impact" effect.

boolean StartSolid

Indicates whenever the trace started in a solid enviroment

boolean AllSolid

True if the entire trace is inside a solid

Personal tools
Navigation