Dear all,
I know how to drag an object, but if I move too fast, say, when my finger move outside the boundaries of the object too fast, the event will just stop and the event.phase is neither cancel or end. In that case, the object will just stop there (without trigger event.phase == end / cancel).
anyone of any method to solve this problem?
my code is as below:
local function drag( event )
if event.phase == “began” then
target = event.target
target.markX = target.x – store x location of object
elseif event.phase == “moved” then
local x = (event.x - event.xStart) + target.markX
target.x = x – move object based on calculations above
elseif event.phase == “ended” or event.phase == “cancelled” then
--event.phase end function
end
Thanks Guys!