Moving objects while being affected by physics

I’m trying to move my object around via the touch method, which works fine expect if they are being affected by physics, in which case the second I stop moving my mouse in the simulator, the object starts to fall (Being affected by gravity) instead of staying in one position.

Here’s the code I’m using.

function moveBuildingBlock(e) if (e.phase=="began") then display.getCurrentStage():setFocus(e.target, e.id); e.target:setReferencePoint(display.CenterReferencePoint); elseif (e.phase=="moved") then e.target.x = e.x; e.target.y = e.y; elseif (e.phase=="ended") then display.getCurrentStage():setFocus(e.target, nil); end end block:addEventListener("touch", moveBuildingBlock) [import]uid: 30068 topic_id: 5867 reply_id: 305867[/import]

this forum category is related to the Lua language itself. your question belongs in the “developer support” or “game edition” forum really [import]uid: 6645 topic_id: 5867 reply_id: 20105[/import]