Hey darkspike,
first of all you should make sure to use a local collision listener instead of a global one (add the listener to the “block” in your case and not to the runtime), if you are not already doing so.
To determine which object collides with the block, you could give each physic object a custom field, which contains its collision type (this is an arbitary value, work out a system that works for you). Here’s a simple example.
local block = display.newRect(0,0,40,40) physics.addBody(block, "dynamic", {density=1, friction=0, bounce=0}) local wall = display.newRect(100,0,10,400) physics.addBody(wall, "static", {density=1, friction=0, bounce=0}) wall.collisionType = "wall" local ground = display.newRect(0,50,400,10) physics.addBody(ground, "static", {density=1, friction=0, bounce=0}) ground.collisionType = "ground" local blockCollision(event) local phase = event.phase local targe = event.target local other = event.other if phase == "began" then if other.collisionType == "wall" then --do something end end end block:addEventListener("collision", blockCollision)
In this example there will only happen something, if the block hits the wall, but not if it hits the floor.
Hope that helps.
Greetings
Torben