Hi everybody!
I have done two scripts, one for camera controll and other for player controll, both use Touch structure. The first is tracking gestures and slides (primary Moved touch phase), the second is tracking ordinary taps. The problem is that touches interfere, and I have to somehow isolate them. I have some thoughts, e.g. create a structure, when if after TouchPhase.Began goes TouchPhase.Moved, camera controll script works, and if after TouchPhase.Began goes TouchPhase.Ended (tap), player controll script works. Unfortunately, I have no idea how organise all this. Is there any sugestions?
You should probably keep track of the time taken for a touch lifecycle to occur, as well as the distance moved by the touch. If a touch goes from Began to Ended within X seconds, and the position when it ended is greater than X distance from the start position, then consider it a tap.
For the swipe movement, you can also only register the swipe movement if the finger moves X units from its start position.
Using those sorts of tests for a swipe/tap, you should be able to accurately distinguish between the two. All the variables you need are in the Touch struct.