Part and body start touching event||doc135537

September 20, 2022

Format

 ENTITY_TOUCH_PART_BEGIN
  • The class to which the function belongs:Entity

Description

The solid object and the part start touching to trigger the event.


Precautions

  • Only valid for player entities

Context

The context content of the event

name type Description
obj1 Entity object instance
part part Part instance


Code Samples

On the server side of the entity templatemount script, register the touch trigger event of this type of entity object and part

Trigger.RegisterHandler(this:cfg(), "ENTITY_TOUCH_PART_BEGIN", function(context)
    local from = context.obj1
    local part = context.part
    print('touch part !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
end)