I have 2 images/object in my game using physics and i want an object to be removed once it collides to another, how can i do this?? help, thanks! [import]uid: 10827 topic_id: 9662 reply_id: 309662[/import]
http://developer.anscamobile.com/content/game-edition-collision-detection
[lua]local function onCollision( event )
if ( event.phase == “began” ) then
print( "began: " … event.object1.myName … " & " … event.object2.myName )
elseif ( event.phase == “ended” ) then
event.object2:removeSelf()
end
end
Runtime:addEventListener( “collision”, onCollision )[/lua] [import]uid: 12482 topic_id: 9662 reply_id: 35174[/import]
thank you so much! [import]uid: 10827 topic_id: 9662 reply_id: 35336[/import]