title: Get the center point between many GameObjects in Unity
body: <p>I have created a game in which you can control X characters at the same time in the same form and they can die at any time. My problem is when I want the game camera to include all these gameobjects.</p>
  
  <p><strong>I thought that a good option is to calculate the central point between the gameobjects in the scene and make the camera follow that point at a certain distance.</strong></p>
  
  <p>I already have the camera code, but I still need to know how to get that central point or another way of doing it. In addition, the camera does not follow any of the axes (X, Y, Z) linearly, since it is placed in such a way that is the view is isometric (the game is in 3D).</p>
  
  <p>As a last important fact, it is that all gameobjects that are running in the game (that are alive), are stored in a <code>public static List &lt;GameObject&gt;</code> to be able to access the components of these gameobjects at any time. Also, if a character (gameobject) dies or is born, the list is updated without problems.</p>
  
  <p>I leave you a graphic example with three different cases, being the black points, the characters that are in the scene (gameobjects) and the red points, the central point (vector) that I would like to find.</p>
  
  <p><a href="https://i.stack.imgur.com/dZ3HK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dZ3HK.png" alt="enter image description here"></a></p>
  
  <p>Also, I leave the camera code so you can test if you have any solution:</p>
  
  <pre><code>public class Camera_Movement : MonoBehaviour {
  
      Vector3 newPos;
      public static List&lt;GameObject&gt; playersInGame = new List&lt;GameObject&gt;();
  
      void Update() {
  
          // Get Central Vector
  
          // Replace playersInGame[0].transform.position with central vector
          //newPos = Vector3.Lerp(gameObject.transform.position, "central vector", Time.deltaTime);
  
          newPos = Vector3.Lerp(gameObject.transform.position, playersInGame[0].transform.position, Time.deltaTime);
          gameObject.transform.position = new Vector3(newPos.x, newPos.y, newPos.z);
  
      }
  }
  </code></pre>
  
  <p>Thank you very much in advance!</p>