Ok so this code makes the object Drag-able AND throw-able… i want it to just be throw-able… like when the player grabs the object they cant drag but if they swipe the object fly’s
function dragBody( event, params ) local body = event.target local phase = event.phase local stage = display.getCurrentStage() if "began" == phase then stage:setFocus( body, event.id ) body.isFocus = true if params and params.center then body.tempJoint = physics.newJoint( "touch", body, body.x, body.y ) else body.tempJoint = physics.newJoint( "touch", body, event.x, event.y ) end if params then local maxForce, frequency, dampingRatio if params.maxForce then body.tempJoint.maxForce = params.maxForce end if params.frequency then body.tempJoint.frequency = params.frequency end if params.dampingRatio then body.tempJoint.dampingRatio = params.dampingRatio end end elseif body.isFocus then if "moved" == phase then body.tempJoint:setTarget( event.x, event.y ) elseif "ended" == phase or "cancelled" == phase then stage:setFocus( body, nil ) body.isFocus = false body.tempJoint:removeSelf() end end return true end player:addEventListener( "touch", dragBody)