title: Separate TouchPhase.Began and TouchPhase.Moved
body: <p>In one of my Android applications (Made with Unity), I would like to move the camera by scrolling with finger on the screen and simultaneously not detect hit, when I touch on any object during scrolling. My problem is that when I want to scroll down the camera with my finger, it firstly also detects hits with the objects. I have one script which is attached to Main Camera.
  Here's the code for better understanding.</p>
  
  <pre><code>//Update function for scrolling and detecting touch. 
  //Do not want to detect touch on objects when scrolling.
  void Update () {
  
      if (Input.touchCount &gt; 0 &amp;&amp; Input.GetTouch(0).phase == TouchPhase.Began) {
  
          checkTouch(Input.GetTouch(0).position);
  
      }
      if (Input.touchCount &gt; 0 &amp;&amp; Input.GetTouch(0).phase == TouchPhase.Moved) {
  
          Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
  
          transform.Translate(0, -touchDeltaPosition.y * Time.deltaTime, 0);
  
          transform.position = new Vector3(0, Mathf.Clamp(transform.position.y, -30, 0), -10);
  
      }
  }
  void checkTouch(Vector3 pos){
      Vector3 wp = Camera.main.ScreenToWorldPoint (pos);
      Vector2 touchpos = new Vector2 (wp.x, wp.y);
      hit = Physics2D.OverlapPoint (touchpos);
  
      if (hit) {
          //Debug.Log (hit.transform.gameObject.name);
          //hit.transform.gameObject.SendMessage ("Clicked", null, SendMessageOptions.DontRequireReceiver);
  
  
          if (hit.transform.gameObject.tag == "item"){
              //do something
          }
      }
  }
  </code></pre>