i am trying to create a script for detecting when a player touches the screen in cartian positions on android but when i touch one of the zones i get UnityException: Index out of bounds. help please
function Update(){
if (Input.touchCount == 1){
var touchOne = Input.GetTouch(1);
//LEFT
if(touchOne.position.x > 130 && touchOne.position.x < 180 && touchOne.position.y > 625 && touchOne.position.y < 675){
print("LEFT");
}
//RIGHT
if(touchOne.position.x > 230 && touchOne.position.x < 280 && touchOne.position.y > 625 && touchOne.position.y < 675){
print("RIGHT");
}
//UP
if(touchOne.position.x > 180 && touchOne.position.x < 230 && touchOne.position.y > 575 && touchOne.position.y < 625){
print("UP");
}
//DOWN
if(touchOne.position.x > 180 && touchOne.position.x < 230 && touchOne.position.y > 675 && touchOne.position.y < 725){
print("DOWN");
}
}
}