title: How can I have an object follow the mouse position when a user clicks?
body: <p>I want an <code>Image</code> to pop up when on the location of my cursor when the user clicks down, and vanish when the user releases the mouse button. I tried the <code>OnMouseDown</code> function but was unable to get it working. I found <code>gameObject.SetActive()</code>, but was unsure of how to use it. I currently am trying to <code>Destroy</code> the object when the mouse is released.</p>
  <pre><code>private void OnMouseDown()
  {
      if (Input.GetMouseButtonDown(0)) 
      {
         Destroy(gameObject);
      }
  }
  
  </code></pre>