util.TraceEntity

From Garry's Mod
Revision as of 12:15, 19 July 2013 by My hat stinks (Talk | contribs)
Jump to: navigation, search
 util.TraceEntity( )

Contents

Description

Runs a trace using the ent's collisionmodel between two points, returning a TraceRes structure

Arguments

table tracedata

Arguments

Entity ent

The entity to use

Returns

table

traceRes

Examples

Example

From sandbox/gamemode/prop_tools.lua, this checks if there are any entities inside our entity

local trace = { start = ent:GetPos(), endpos = ent:GetPos(), filter = ent }
local tr = util.TraceEntity( trace, ent ) 
if ( tr.Hit ) then
 ...


Personal tools
Navigation