how to find the width of a parent gameobject without using bounds?

I want to instantiate a group of platforms so that they are exactly next to each other. so i made a group of 2-3 platforms and put them into a parent i need to find the width of the parent gameobject so that i can place the next gameobject so i added a boxcollider component to the parent and i have used the bounds to find the width and that worked but now the problem is when i raycast to detect that the player is grounded or not,it hits the parent collider and not the platforms,how can i solve this problem.
is there any other way to find the width of the parent gameobject?
or is there any other way that i can detect the actual platform colliders and not the parent gameobject colliders?

You can still use those colliders if it makes your job easier. All you have to do is assign your new colliders to their own physics layer, go into the physics settings and prevent those colliders from interacting with any other layer, and when you do your RayCast, user a layer mask that excludes those colliders.

Something like this should work for you when you want to do your raycast, as long as you set the ignored colliders to the ‘Excluded Layer’ physics layer.

int allLayersExceptExcludedLayer = ~(1 << LayerMask.NameToLayer("Excluded Layer"));
Physics.Raycast(Ray, out hitInfo, 10f, allLayersExceptExcludedLayer);

I assigned the parent gameobject to the ignore raycast layer so the raycast now does not detect the parent collider only the child colliders are detected,this is also working.