Garry's Mod Wiki

PhysCollide:TraceBox

  Vector, Vector, number PhysCollide:TraceBox( Vector origin, Angle angles, Vector rayStart, Vector rayEnd, Vector rayMins, Vector rayMaxs )

Description

Performs a trace against this PhysCollide with the given parameters. This can be used for both line traces and box traces.

Arguments

1 Vector origin
The origin for the PhysCollide during the trace
2 Angle angles
The angles for the PhysCollide during the trace
3 Vector rayStart
The start position of the trace
4 Vector rayEnd
The end position of the trace
5 Vector rayMins
The mins of the trace's bounds
6 Vector rayMaxs
The maxs of the trace's bounds

Returns

1 Vector
Hit position of the trace. This is false if the trace did not hit.
2 Vector
Hit normal of the trace
3 number
Fraction of the trace. This is calculated from the distance between startPos, hitPos, and endPos.