title: Bullet-Hell Tool (Unity C#) - Rotate Half-Circle of Objects / Projectiles Towards Directional Vector2
body: <p><strong>_Greetings</strong><br />
  Greetings. I am working on c# script for a 'bullet-hell' tool in Unity and I have gotten stuck trying to produce a crescent / half-circle of objects - that turns toward the traveling direction. The scripts spawn a perfect half-circle every time and keep the objects there, no matter object-amount. No problem there, the circle is however never turned towards the right direction.</p>
  <hr />
  <p><strong>_Question</strong><br />
  <strong>What I am trying to achieve is for the half-circle to point towards the travel-direction of the centerObject. This travel direction is described via a Vector2 between (1,1) and (-1,-1). How can I use this vector to turn the half-circle in the direction of travel?</strong></p>
  <hr />
  <p><a href="https://i.stack.imgur.com/FlZYC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FlZYC.png" alt="Four Moving half-circle, moving away from spawn point." /></a><br />
  <em>There are multiple instances of InitializeOrbit, each responsible for its own half-circle and with a corresponding move direction Vector2.</em></p>
  <hr />
  <p><strong>_Code</strong><br />
  In the first script, the 'theta' is first calculated, whereafter the objects are spawned.</p>
  <pre><code>public void InitializeOrbit()
  {
      for (int i = 0; i &lt; numberOfOrbits; i++)
      {
           float theta = (1 * Mathf.PI / numberOfOrbits) * i;
           Instantiate(OrbitPrefab, orbitLocation, transform.rotation);
      }
  }
  </code></pre>
  <p>And in the second, the theta is used to calculate the position of the individual objects.</p>
  <pre><code>public void OrbitSource ()
  {
      Vector2 offset = new Vector2(Mathf.Sin(theta) * orbitRadius, Mathf.Cos(theta) * orbitRadius);
      transform.position = (Vector2)centerTransform.position + offset;
  }
  </code></pre>
  <hr />
  <hr />
  <p>I hope I have provided proper information, thanks in advance. I have tried reading <a href="https://stackoverflow.com/questions/56738064/how-to-place-spheres-in-a-half-circle-shape-between-2-points/56738606">How to place spheres in a half circle shape between 2 points</a> - But have sadly not been able to use this information correctly to attain my desired result.</p>