title: How can i make equal spaces between the squad members in the circle formation?
body: <p>When it's square formation i can set the space fine.
  But i'm not sure how to do it with the circle formation.
  Inside the FormationSquare method i'm using the space variable for the square formation. Now i need to do the same idea for the circle formation too.</p>
  
  <p>Maybe inside the RandomCircle to change something and using the space variable ?</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class SquadFormation : MonoBehaviour
  {
      enum Formation
      {
          Square, Circle
      }
  
      public Transform squadMemeber;
      public int columns = 4;
      public int space = 10;
      public int numObjects = 20;
      public float yOffset = 1;
  
      private Formation formation;
  
      // Use this for initialization
      void Start()
      {
          formation = Formation.Square;
          ChangeFormation();
      }
  
      // Update is called once per frame
      void Update()
      {
          if (Input.GetKeyDown(KeyCode.F))
          {
              GameObject[] objects = GameObject.FindGameObjectsWithTag("Squad Member");
              if (objects.Length &gt; 0)
              {
                  foreach (GameObject obj in objects)
                      Destroy(obj);
              }
  
              ChangeFormation();
          }
      }
  
      private void ChangeFormation()
      {
          switch (formation)
          {
              case Formation.Square:
  
                  for (int i = 0; i &lt; 23; i++)
                  {
                      Transform go = Instantiate(squadMemeber);
                      Vector3 pos = FormationSquare(i);
                      go.position = new Vector3(transform.position.x + pos.x, 0, transform.position.y + pos.y);
                      go.Rotate(new Vector3(0, -90, 0));
                      go.tag = "Squad Member";
                  }
                  formation = Formation.Circle;
                  break;
  
              case Formation.Circle:
  
                  Vector3 center = transform.position;
                  for (int i = 0; i &lt; numObjects; i++)
                  {
                      Vector3 pos = RandomCircle(center, 5.0f);
                      var rot = Quaternion.LookRotation(center - pos);
                      pos.y = Terrain.activeTerrain.SampleHeight(pos);
                      pos.y = pos.y + yOffset;
                      Transform insObj = Instantiate(squadMemeber, pos, rot);
                      insObj.rotation = rot;
                      insObj.tag = "Squad Member";
                  }
                  formation = Formation.Square;
                  break;
          }
      }
  
      Vector2 FormationSquare(int index) // call this func for all your objects
      {
          float posX = (index % columns) * space;
          float posY = (index / columns) * space;
          return new Vector2(posX, posY);
      }
  
      Vector3 RandomCircle(Vector3 center, float radius)
      {
          float ang = Random.value * 360;
          Vector3 pos;
          pos.x = center.x + radius * Mathf.Sin(ang * Mathf.Deg2Rad);
          pos.z = center.z + radius * Mathf.Cos(ang * Mathf.Deg2Rad);
          pos.y = center.y;
          return pos;
      }
  }
  </code></pre>