Hey, i’m using this code to check Right and Left clicks:
if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began){
Touch touch = Input.GetTouch(0);
if (touch.phase == TouchPhase.Began){
if (touch.position.x > (Screen.width/2)){
rigidbody2D.AddForce (Vector2.up*300);
rigidbody2D.AddForce (Vector2.right*150);
rigidbody2D.velocity = new Vector2(0.0f,0.5f);
transform.rotation = Quaternion.Euler(0,0,0);
}
if (touch.position.x <= (Screen.width/2)){
rigidbody2D.AddForce (Vector2.up*300);
rigidbody2D.AddForce (Vector2.right*-150);
rigidbody2D.velocity = new Vector2(0.0f,0.5f);
transform.rotation = Quaternion.Euler(0,180,0);
}
}
}
But when it detects a touch it has a delay to check the next touch, in my project I need to remove this delay so that the person can touch the right and quickly after touching the left.