I experience a problem with multitouch on android device. Cannot say exactly what to do to replicate it but as I’m getting an on_input message I try to iterate through the touches. Once in a while the whole action.touch table is nil. What would cause that? Should that be possible?
It’s of course simple to fix not throwing errors but I’m afraid I’m losing important touch data (eg. a release after a press)
06-05 14:38:44.521 871 897 E defold : ERROR:SCRIPT: lux/input/gestures.lua:121: bad argument #1 to 'ipairs' (table expected, got nil)
06-05 14:38:44.521 871 897 E defold : stack traceback:
06-05 14:38:44.521 871 897 E defold : [C]: in function 'ipairs'
06-05 14:38:44.521 871 897 E defold : lux/input/gestures.lua:121: in function 'on_input'
06-05 14:38:44.521 871 897 E defold : client/player_controller.script:133: in function <client/player_controller.script:128>
...
06-05 14:38:44.521 871 897 E defold : ERROR:SCRIPT: lux/ui/button.lua:312: bad argument #1 to 'ipairs' (table expected, got nil)
06-05 14:38:44.521 871 897 E defold : stack traceback:
06-05 14:38:44.521 871 897 E defold : [C]: in function 'ipairs'
06-05 14:38:44.521 871 897 E defold : lux/ui/button.lua:312: in function 'on_input'
06-05 14:38:44.521 871 897 E defold : lux/ui/button.lua:267: in function 'batch_on_input'
Code for gestures.lua on_input() (similar for button.lua):
if action_id ~= m_touch then return end
for i,touch in ipairs(action.touch) do -- failing line
result = handle_touch(touch)
if result ~= nil then
table.insert(actions, result)
end
end
return actions