Question by
bokchoy4221 · Dec 29, 2016 at 09:24 AM ·
collider2dsizeboxcollider2dwidthlength
Getting Child Box Collider2D Size
Hi guys,
i am having a bit of trouble with this. So i have a list of objects. I can get the width of each box collider that is assigned to these objects.
with this code
for (int i = 0; i < platformPools.Length; i++)
{
platformWidth[i] = platformPools[i].pooledObject.GetComponent<BoxCollider2D>().size.x;
}
I now have an object which has multiple children with their own box colliders assigned to them. However with the above, it is only getting the width of the parent collider.
How do i make the above code detect the total length of parent + child colliders combined?
Thanks
untitled.png
(13.3 kB)
Comment