TraceResult
Sandbox.Game
Derives from ValueType

Fields

The physics object that was hit, if any

int Bone

The id of the hit bone (either from hitbox or physics shape)

The direction of the trace ray

The end or hit position of the trace

The entity that was hit, if any

float Fraction

A fraction [0..1] of where the trace hit between the start and the original end positions

bool Hit

Whether the trace hit something or not

The hitbox hit, if at all. Requires Trace.UseHitboxes to work.

The hit position of the trace

The hit surface normal (direction vector)

The physics shape that was hit, if any

Whether the trace started in a solid

The start position of the trace

The physical properties of the hit surface

string[] Tags

The tags that the hit shape had

The triangle index hit, if we hit a mesh physics shape

Properties

float Distance { get; }

The distance between start and end positions.