title: Unity touch/mouse collide instead of MouseDown()
body: <p>I have a sprite which at the moment I detect the mouse click on it. </p>
  
  <p>However I really need to detect when the finger or mouse touches or moves across the sprite because the finger/mouse click event will occur somewhere else on the screen and not on top of the sprite.</p>
  
  <pre><code>public class Hand : MonoBehaviour
  {
  
      private void OnMouseDown()
      {
          if (Input.GetMouseButtonDown(0))
          {
              this.transform.gameObject.SetActive(false);
          }
      }
  }
  </code></pre>
  
  <p>Update:
  I tried to detect both touching the sprite and the mouse is down but I dont get the button clicked. I can remove the <code>&amp;&amp; Input.GetMouseButtonDown(0)</code> and it will work if the mouse moves over but I want both mouse/finger over the sprite and the pressed down.</p>
  
  <pre><code>private void Update()
  {
      Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
      RaycastHit hit;
  
      if (Physics.Raycast(ray, out hit, 1000) &amp;&amp; Input.GetMouseButtonDown(0))
          hit.collider.GetComponent&lt;Button&gt;().onClick.Invoke();
  }
  </code></pre>