So heres some of the code and this is making the error…
local box = display.newImageRect("box.png", 30, 30) physics.addBody(box, "static", {bounce = 0} ) box.x = display.contentWidth \* 0.5 box.y = 415 box.value = 1 box.isVisible = true local onCollision = function(self, event) if event.phase == "began" then local hit = self.value local other = event.other.value if other == 1 then print("helloo") display.remove(box) box = nil end end end local function onAccelerate( event ) if box.x \> display.contentWidth \* 0.1 and box.x \< display.contentWidth \* 0.9 then box.x = box.x + (event.xInstant) \* 200 end if box.x \> display.contentWidth \* 0.9 then box.x = display.contentWidth \* 0.89 end if box.x \< display.contentWidth \* 0.1 then box.x = display.contentWidth \* 0.11 end end Runtime:addEventListener( "accelerometer", onAccelerate )
the error doesnt pop up in the simulator but when i builld the app for my android phone it pops up when the circle collides with the box…(i have circle randomly spawning and you cant collide with the box if you do then the box is supposed to remove) and the box removes on the simulator and everything works but when i build for device it gives me the error…(ive narrowed it down the the code above and thats the code thats making it cause the error…)
thanks for any help!