event.phase

Type String
Event collision
Revision Release 2022.3683
Keywords collision, phase, physics

Overview

Indicates the collision phase for the physics collision listener:

Example

local function onCollision( event )
    if ( event.phase == "began" ) then
        print( "began: " .. event.object1 .. " & " .. event.object2 )
    elseif ( event.phase == "ended" ) then
        print( "ended: " .. event.object1 .. " & " .. event.object2 )
    end
end