Garry's Mod Wiki


table Entity:GetTouchTrace()


Returns the last trace used in the collision callbacks such as ENTITY:StartTouch, ENTITY:Touch and ENTITY:EndTouch.

This returns the last collision trace used, regardless of the entity that caused it. As such, it's only reliable when used in the hooks mentioned above



Dispatches an explosion at the point of impact with another entity.

function ENT:Touch( otherEntity ) local tr = self:GetTouchTrace() local hitPos = tr.HitPos local effectdata = EffectData() effectdata:SetOrigin( hitPos ) util.Effect( "Explosion", effectdata ) end

Page Links

Special Pages



Render Time: 72ms

DB GetPage 42
Generate Html 7
SaveChanges (1) 8
Render Body 0
Render Sidebar 12