Why the collision began event is late.
local physics = require( "physics" ) physics.start() physics.setGravity( 0, 0 ) physics.setDrawMode( "debug" ) local staticLine = display.newLine( 0, 100, 1000, 100 ) staticLine.strokeWidth = 1 physics.addBody( staticLine, "static", {isSensor = true}) local ball = display.newCircle( 40, 300, 20 ) physics.addBody( ball, {radius = 20, isSensor = true} ) ball:setLinearVelocity( 300, -300 ) ball:addEventListener( "collision", function(event) if (event.phase == "began") then physics.pause( ) end end )
physics pauses when at position
But I want to pause it at position
How can I solve it?
Thanks!