Garry's Mod Wiki

ENTITY:Touch

ENTITY:Touch( Entity entity )

Description

Called every tick for every entity being "touched".

See also ENTITY:StartTouch and ENTITY:EndTouch.

This only works for brush entities and for entities that have Entity:SetTrigger set to true.
For physics enabled entities, this hook will not be ran while the entity's physics is asleep. See PhysObj:Wake.

Arguments

1 Entity entity
The entity that touched it.

Example

function ENTITY:Touch(entity) self:EmitSound("ambient/explosions/explode_" .. math.random(1, 9) .. ".wav") self:Remove() end

Page Links


Special Pages


Wikis

?

Render Time: 50ms

DB GetPage 8
Generate Html 4
SaveChanges (1) 24
Render Body 0
Render Sidebar 12