Shouldn’t this make the box pass through the platform?
local platform = display.newRect( 20, 200, 280, 15 )
platform.myName = "platform1"
physics.addBody(platform, "static", { density=1.0 })
platform.isSensor = true
local box = display.newRect( 20, 20, 50, 50 )
box:setFillColor(255,255,0,255)
box.myName = "box"
physics.addBody(box, "dynamic", { density=1.0 , bounce=.7 })
box.preCollision = onLocalPreCollision
box:addEventListener( "preCollision", box )
Also read the comment on this non-working example from the API docs:
http://developer.anscamobile.com/reference/index/bodyissensor
[import]uid: 21280 topic_id: 7512 reply_id: 307512[/import]