GetTriggeringPart

Constructor:

GetTriggeringPart()

Description

Returns the other part objects that the part is in contact with.

Return Value

Class Name Description
table The list of the part objects in contact.

Examples

Create a part, and output the names of other parts that the part is in contact with when the part is touched.

local temp = RWObject.Create("Part") -- create an instance object of Part
temp.Position = Vector3.New(2,2,2) -- set the coordinates of the instance object
temp.Parent = WorkSpace -- set the parent of the created object as WorkSpace
temp.TriggerEnter:Connect(function(avr)
    local touchparts = temp:GetTriggeringPart()--
    for k,v in pairs(touchparts) do
    print(v.Name)
    end
end)