title: How to get size of parent game object?
body: <p>I have three child game objects(as you can see in below picture with <strong>Red</strong>, <strong>Pink</strong> &amp; <strong>Blue</strong>). They are child of parent game object Green.</p>
  
  <p>I don't know, how to calculate size of Parent(Green) <em>GameObject</em>?</p>
  
  <p>I am creating all these game objects at runtime using this code:</p>
  
  <pre><code>GameObject CreatePattern(int difficultyLevel)    
      {    
          GameObject gameObjectTemp = new GameObject();    
          SinglePattern singlePattern;    
          gameObjectTemp = (GameObject) Instantiate(gameObjectTemp);   
  
  
          singlePattern = freeRunDataHandler.GetSinglePatternRandom(1);    
          GameObject gameObjectSingleObject = null;    
          foreach (SingleObject singleObject in singlePattern.singleObjectList)    
          {
                  gameObjectSingleObject = GetGameObjectByCategory(singleObject.catergory, singleObject.type);
  
              if (gameObjectSingleObject != null)    
              {    
                  gameObjectSingleObject = (GameObject) Instantiate(gameObjectSingleObject, new Vector3(singleObject.positionX, singleObject.positionY, singleObject.positionZ), Quaternion.identity);    
                  gameObjectSingleObject.transform.localScale = new Vector3(singleObject.length, 1, singleObject.width);    
                  gameObjectSingleObject.transform.parent = gameObjectTemp.transform;    
              }    
          }        
  
          return gameObjectTemp;    
      }
  </code></pre>
  
  <p>This function returns parent(Green) gameObject after adding all childs. My Parent(Green) have nothing attached to it not even any component(BoxCollider, MeshFilter, MeshRenderer, etc..).</p>
  
  <p>I had attached BoxCollider, MeshRenderer &amp; MeshFilter(Just for testing) &amp; i tried on parent:</p>
  
  <pre><code>parent.collider.bounds.size.x  ----- &gt; box collider
  parent.renderer.bounds.size.x  ----- &gt; mesh renderer
  </code></pre>
  
  <p>But nothing works. There return 1 or zero in cases.
  Please help me in how to get size of Parent(Green) GameObject?</p>
  
  <p><img src="https://i.stack.imgur.com/hMuZA.png" alt="enter image description here"></p>