title: Unity2D - Enemy shoot at player in a cone shaped pattern
body: <p>I am trying to set up an enemy that will shoot at the player in a cone shape/shotgun shape. If I set the projectile script to <code>transform.position += transform.right * m_Speed * Time.deltaTime;</code> then the cone shape works as intended, just only to the right and not in the direction of the player. With the current setup (below), the projectile will shoot at the player, but all the bullet prefabs will be on top of each other and all going in the same direction, not in a cone shape.</p>
  <p>How can I adjust this so the enemy will shoot at the player but retain the cone shape?</p>
  <p>Enemy Script</p>
  <pre><code>    aimAngle = 60f;
      for (int i = 0; i &lt; spreadShot; i++)
      {
          var shotRotation = gameObject.transform.rotation;
          shotRotation *= Quaternion.Euler(0, 0, aimAngle);
  
          GameObject clone = Instantiate(projectile, new Vector2(gameObject.transform.position.x, gameObject.transform.position.y), shotRotation);
          aimAngle = aimAngle - 30f;
  
          Vector3 direction = (Vector3)((player.transform.position - transform.position));
          direction.Normalize();
  
          clone.GetComponent&lt;Projectile&gt;().Setup(direction);
      }
  </code></pre>
  <p>Projectile.cs</p>
  <pre><code>[SerializeField] float m_Speed;
  Vector3 shootDir;
  
  public void Setup(Vector3 shootDir)
  {
      this.shootDir = shootDir;
  }
  
  private void Update() 
  {
      transform.position += shootDir * m_Speed * Time.deltaTime;
  }
  </code></pre>