util.TraceHull

From GMod Wiki

Jump to: navigation, search
Function
Syntax util.TraceHull( Trace )
Where is this used?
Description:
Allows you to do a trace.
Returns: traceres
Part of Library: util
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Util.TraceHull]Util.TraceHull [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionTrace 80 units forward of a players hull.
Used onNewerShared.png
Code
local ply = LocalPlayer()
local pos = ply:GetPos()
local ang = ply:GetAimVector()
 
local tracedata = {}
tracedata.start = pos
tracedata.endpos = pos + ( ang * 80 )
tracedata.filter = ply
tracedata.mins = ply:OBBMins()
tracedata.maxs = ply:OBBMaxs()
 
local trace = util.TraceHull( tracedata )
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox