Hi,
I have a dynamic object and a static object. I am moving the static object towards the dynamic object, I need the static object to pass through the dynamic object (as it is a sensor), but when it does there is no physics collision detected on the dynamic object. But if I change the isSensor property to false in the static property then the collision event fires… has anyone else had this issue? I assume it should fire when isSensor property is true?
I am using build 2014.2187
here is the code
physics = require( "physics" ) physics.start() physics.setDrawMode( "hybrid" ) local floor = display.newRect(0, 0, 1500, 100) floor.y = 900 physics.addBody(floor, "static") local box = display.newRect(0, 0, 100, 100) box.x = 100 box.y = 800 physics.addBody(box, "dynamic") local sensor = display.newRect(0, 0, 100, 100) sensor.x = 500 sensor.y = 800 physics.addBody(sensor, "static") sensor.isSensor = true function GameLoop() sensor.x = sensor.x - 5 end function CollisionHandler(event) print(event.phase) end box:addEventListener( "collision", CollisionHandler ) Runtime:addEventListener( "enterFrame", GameLoop )