title: How to make a projectile instantiate in the direction of the cursor
body: <p>I'm currently working on a bullet hell game for fun and to work on my Unity and C# code writing skills. I'm currently having an issue with Instantiating a projectile, and instantiating that object at a certain rotation and velocity. The rotation of the projectile I want to face the cursor, and the velocity is fixed. My code is as shown:</p>
  
  <pre><code>    Vector3 sp = Camera.main.WorldToScreenPoint (transform.position);
      Vector3 dir = (Input.mousePosition - sp).normalized;
      Instantiate (projectile, sp);
      GetComponent&lt;Rigidbody2D&gt;().AddForce (dir * 500);
  </code></pre>
  
  <p>I know it's wrong in the fact that my <em>Instantiate</em> function is written incorrectly, but I'm struggling in figuring out how to correctly write the <em>Instantiate</em> function and how to make the projectile face the cursor in terms of rotation.</p>
  
  <p>Thanks a ton for your help, if you need any more information, just ask.</p>