To get the bounds of an object that has MeshRenderers, I use the following function:

```
public static Bounds BoundsFromTransform(Transform uTransform)
{
Bounds bounds = new Bounds(uTransform.position, Vector3.zero);
foreach (Renderer renderer in uTransform.GetComponentsInChildren<Renderer>())
{
bounds.Encapsulate(renderer.bounds);
}
Vector3 nOff = bounds.center - uTransform.position;
return new Bounds(nOff, bounds.size);
}
```

I would now like to get bounds of an object that contains the following:

1) A canvas / canvas scaler 2) Panel with an image 3) Text 1 4) Text 2 etc.

How could I get the bounds from such an object?

My approach was to use the "ItemmenuCanvas" transform's localScale as I thought this would determine this complex object's scale, but its localScale was too small to feel right.

Here are some screenshots:

Thank you very much!

- Serverfault Help
- Superuser Help
- Ubuntu Help
- Webapps Help
- Webmasters Help
- Programmers Help
- Dba Help
- Drupal Help
- Wordpress Help
- Magento Help
- Joomla Help
- Android Help
- Apple Help
- Game Help
- Gaming Help
- Blender Help
- Ux Help
- Cooking Help
- Photo Help
- Stats Help
- Math Help
- Diy Help
- Gis Help
- Tex Help
- Meta Help
- Electronics Help
- Stackoverflow Help
- Bitcoin Help
- Ethereum Help