How do I record multiple touch inputs at the same time?


#1

If so how can I do that?


#2
  1. Add this to input: multi1
  2. Add this to init: msg.post(".", "acquire_input_focus")
  3. Add this to final: msg.post(".", "release_input_focus")
  4. Add this to action:
    if action_id == hash("t") then for i, pos in ipairs(action.touch) do

This is what I use for my multiple touch games :slight_smile:


Simple Example Of Multi-Touch On Mobile Devices?
Input not registering when tested
#3

Thanks I’ll definitely try it out


#4

What other methods can I use for this?


#5

You need to iterate through the action.touch table and check what touch inputs you get, there is no other method.


#6

Can I still work with action.y and action.x using this method?


#7

Each entry in action.touch contains the x and y position of the touch point. See this section in the input manual: https://www.defold.com/manuals/input/#_touch_triggers