- Home /
Managing Multiple Touch Inputs
Hi
I'm just starting out with Unity and need some assistance understanding touch input on something like iOS.
I control my character by clicking and holding, the character moves in the direction of the mouse. You can also zoom the camera in and out with the scroll wheel. This makes perfect sense to me, but in this case each instruction sits with its own physical input.
Translating this to touch input however, every action is made with a touch so its not as simple as saying:
if (scrolling) //scroll if (clicking) //move
I know I can access an array of touches through Input
, but how do I keep each touch action from effecting one another?
The mouse clicks automatically translate to touches which makes character movement work in an instant, so thats touch(0)
accounted for. How might I then handle, ok there is another two fingers on screen doing a pinch gesture (to zoom) without effecting the original touch.
Can you cancel touches? Are touches associated with objects?
Thanks.
Your answer
![](https://koobas.hobune.stream/wayback/20220613123134im_/https://answers.unity.com/themes/thub/images/avi.jpg)