Hi, Corona Community.
I get an error when I call physics.stop() during a collision. Just like this :
local function onCollision(e) if e.phase == "began" then if e.target.type == "ok" then Runtime:removeEventListener("enterFrame", e.target) display.remove( e.target ) points = points+1 if points == Amount then physics.stop() print("U WIN") removeAll = function(group) if group.enterFrame then Runtime:removeEventListener("enterFrame", group); end if group.touch then group:removeEventListener("touch", group); Runtime:removeEventListener("touch", group); end for i = group.numChildren, 1, -1 do if group[i].numChildren then removeAll(group[i]); else if group[i].enterFrame then Runtime:removeEventListener("enterFrame", group[i]); end if group[i].touch then group[i]:removeEventListener("touch", group[i]); Runtime:removeEventListener("touch", group[i]); end end end end removeAll(group); end
the error as in the terminal :
ERROR: 72.lua:107: physics.stop() cannot be called when the world is locked and in the middle of number crunching, such as during a collision event
Is this going to affect the game when it’s built to a device? everything is fine on the simulator.
what does “physics.stop() cannot be called when the world is locked and in the middle of number crunching, such as during a collision event” mean?