entity touch entity event||doc135529

September 20, 2022

Format

 ENTITY_TOUCH_ALL
  • The class to which the function belongs:Entity

Description

This event is fired when the entity object touches the entity object


Context

The context content of the event

name type Description
obj1 Entity initiating contact entity
obj2 Entity contacted entity


Code Samples

On the server side of the entity templatemount script, when registering this type of entity object touches other entitiesCallback, destroys the touched entity

Trigger.RegisterHandler(this:cfg(), "ENTITY_TOUCH_ALL", function(context)
    local from = context.obj1
    local to =context.obj2
    to:destroy()
end)