Is there a way to limit the amount of touches that can be called at a time? I just want the user to be able to tap once on the screen at a time ( so shouldn’t be able to tap in two different locations or more on the screen at once ).
for (var touch : Touch in Input.touches) {
if (touch.phase == TouchPhase.Began) {
}
}
Check if( Input.touchCount == 1 ) { … }
You’ve got the list of all the touches. What you could do it just only process the first touch.
var firstTouch = Input.touches[0];
if (firstTouch.phase == TouchPhase.Began)
{
// Handle touch
}
Input.multiTouchEnabled = false;
int touches = Mathf.Clamp(Input.touches,0,1);