Collision troubles

Hello again,

i have a small problem regarding collisions,
i have this function :
[lua]local function ballsCollision(event)
if event.phase == “began” then
if event.other.name == “rock” then
event.other.isVisible = false
event.other = nil
event.target.isVisible = false
event.target:removeSelf()
event.target.over = true
removeSmoothPath()
gameisActive = false
gameisActive = true
newExplosion(event.target.x, event.target.y)
newExplosion(event.other.x, event.other.y)

elseif event.other.name == event.target.name then
event.other:removeSelf()
event.other = nil

end
end
end[/lua]

but when object hits the “rock”, object and rock gets deleted from screen, but physical state of “rock” is still there and other objects colliding with invisible “rock”

can anyone tell me how can i avoid this behavior? many thanks [import]uid: 16142 topic_id: 17960 reply_id: 317960[/import]

What version of Corona are you using?

Are you getting any error messages?

Try only removing on event.phase == “ended” and let me know if that helps :slight_smile:

Peach [import]uid: 52491 topic_id: 17960 reply_id: 68713[/import]

Why not changing

event.other = nil  

to

event.other:removeSelf()  

? [import]uid: 13097 topic_id: 17960 reply_id: 68718[/import]