Whenever you drag a physics object with gravity on the object falls off of the touch spot when the touch becomes stationary.
My code:
local physics = require("physics")
physics.start()
physics.setGravity( -9.8, 0 )
local bar = display.newRect(0,0,25,960)
physics.addBody(bar, "static", { density=0.3})
local box = display.newRect(100,100,100,100)
physics.addBody(box, { density=0.3})
local function boxlistener(event)
if event.phase == "began" or event.phase == "moved" or event.phase == "stationary" then
box.x = event.x
box.y = event.y
end
end
box:addEventListener("touch", boxlistener )
Is this a bug or something I’m doing wrong? [import]uid: 10903 topic_id: 8594 reply_id: 308594[/import]