I am having this error popping up when i restart the game :
(ERROR: Attempt to remove an object that’s already been removed from the stage or whose parent/ancestor group has already been removed.)
I am using jet:removeSelf() in a function called by a collision (code below)
function explode() Runtime:removeEventListener("enterFrame", moveJet) Runtime:removeEventListener("enterFrame", wrap) jet:removeSelf() end local function onCollision(event) if event.phase == "began" and gameIsActive == true then local obj1 = event.object1; local obj2 = event.object2; if obj1.name == "jetplayer" and obj2.name == "BCloud1" then explode() end end end Runtime:addEventListener( "collision", onCollision )
So the game works fine the first time but not when you restart. any ideas on how to fix the problem ?