Help removing objects with physic

I have some balls falling and having collision with objects, and they works great, the problem is when i want to remove the balls that are going to be out of the screen.
i have tried postCollision,phase=ended, onComplete=function() remove…,timers… but always happens the same…

I have placed sensors, on left ,right ,top and bottom…so when they detect a collision they remove the ball, but then is when the collisions start to make strange things, some of the ball that are inside dont detect collision, but they bounce when they hit other objects…i dont understand, Any idea what is happening?

This function check collisions, is called with Runtime (“collision”)

[code]
local function checkCollision(event)

if ( event.phase == “ended” ) then
if (event.object1.type==1) then

–drums
local availableChannel = audio.findFreeChannel()
local result = audio.freeChannels

if (result>0) then
if (event.object1.subtype==1) then
audio.play( jum , { channel=availableChannel })
end

end

event.object1.alpha=1

end

if (event.object1.type==“D”) then – This check collision with wall to destroy the ball

event.object2:removeSelf()
event.object2=nil
end

end

end
[/code] [import]uid: 113117 topic_id: 22258 reply_id: 322258[/import]

Perhaps a PreCollision event would help you? [import]uid: 10389 topic_id: 22258 reply_id: 88753[/import]

I think part of this is not knowing whether object1 is the wall or the ball; you should code for both. (Unless I have misunderstood?) [import]uid: 52491 topic_id: 22258 reply_id: 88813[/import]