Question by
Tramplex · Oct 16, 2019 at 09:27 PM ·
touch controlsmultitouch
How to track touches properly?
Im making a twin stick game. I had each joystick remember touchId that touched them. But In situation when you touch both sticks and release first, second one has wrong id. I tried to track touch releases and reassign correct touchIDs like this:
Stick#1 ID0 Stick#2 ID1 (you release Stick#1) Stick#2 ID1->ID0
But after this:
(you touch Stick#1 again) Stick#1 ID0 Stick#2 ID0
So it added new touch in the beggining of touch arrays, and both joysticks now track same touch. And now on it like "remembered" touchIds for each finger untill i release both of them. The question is: How do i track them properly then?
Comment
Your answer