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

If so how can I do that?

  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:

4 Likes

Thanks I’ll definitely try it out

What other methods can I use for this?

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

2 Likes

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

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

1 Like