event.x

Type Number
Event preCollision
Revision Release 2022.3683
Keywords preCollision, x
See also event.y

Overview

The x position where the pre-collision event occurred. Note that the reported collision position can be influenced by physics.setAverageCollisionPositions() and physics.setReportCollisionsInContentCoordinates().

Example

local function onPreCollision( event )
    print( "position: " .. event.x .. "," .. event.y )
end