Today we’ve discovered, that when mashing fast on a touch enabled object [with multitouch enabled], we can get multiple “began” touch events with the same touch id.
Funny thing, only one ended phase.
We’ve submitted a bug already, but just wanted to see if others had similar issues.
It’s possible to get this error on iOS and Android.
Here’s a sample code I used to test it:
system.activate("multitouch") local grp = display.newGroup() local rect = display.newRect(50, 50, 50, 50) local touch rect:addEventListener("touch", function(event) print("Event phase: " .. event.phase .. " event id: " .. tostring(event.id)) if event.phase == "began" then if touch ~= nil then print("IT HAPPENED!!!!") end touch = event.id elseif event.phase == "ended" and event.id == touch then touch = nil end end)
When you mash very fast you will eventually get the “IT HAPPENED” log and you will see two began events with same id.