void update(){
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) {
var startpos = Camera.main.ScreenToWorldPoint (Input.GetTouch (0).position);
if (Physics2D.Raycast (startpos, Vector2.zero, 1 << LayerMask.NameToLayer ("Ballon"))) {
Debug.Log ("Hits a ballon");
Destroy (gameObject);
}
}
}
Raycast has no direction. Vector2.zero tells it to move 0 in x direction and 0 in y direction. If you want to cast towards the center, you need a directon not an end point.
So:
Vector3 direction = Vector2.zero - startpos;
//subtracting from 0 will of course be the same as:
Vector3 direction = -startpos;
Or you can use a Physics.LineCast which takes a start and an end point.