Encapsulate Bounds Problem [SOLVED]

Hi,

I am trying to get the total dimensions for an object and all it’s children. I am very close but can’t quite seem to get over the last hurdle.

I am able to iterate through the children and see all objects in the array.

I am also able to see the individual children Bounds sizes.

But I cannot get it to give me the total dimensions of them all. From what I can tell I need to encapsulate them, but my total encapsulation only gives me the bounds size for the parent object.

[Edit] Problem solved as I eventually found this post (Eric5h5 to the rescue . . . again!):

Thanks

Paul

Since Encapsulate only encapsulates a point (Vector3) in space r.bounds seems not to be a valid argument.

#Wrong, it encapsulates with a point, or bounds - check the doco page

.

You could try (not testet):

for(r in renderers){
   totalBounds.Encapsulate(r.min);
   totalBounds.Encapsulate(r.max);
}