Unity 2D: Is there a way to create a single collider on a parent game object that covers all of that parent's children?

I’ve been prototyping a 2D platformer using Unity’s built-in “Quad” game objects to create interesting collision shapes, like slopes. All I want to know is if there’s a simple way to put two child Quads - imagine they are in the shape of an “L” - into a single parent, and then create a 2D collider (or colliders) on the parent that encompasses these children.

I know I can do something like create multiple box or edge colliders on the parent and alter the values of those colliders accordingly. However, this has proven very annoying and nonintuitive; maybe I’m just doing it wrong, but I would appreciate any helpful solutions anyway.

I did a bit more research, and what I was looking for is a Composite Collider 2D, which allows one to create a polygon collider out of multiple child colliders.

To do this, simply create a parent game object, and add as many children to it as you need. Give each child a collider, but make sure to check the “Used By Composite” box on the collider 2D component. I also used Geometry Type - Polygons on my composite collider, as that yielded the results I needed for my own custom collision system. The only “catch” to this is that you must use a Rigidbody2D on the parent game object, but I just set mine to kinematic and did not allow movement on any axes.

Ultimately, it might be best to create your collision shapes as sprites in a program like Photoshop, and then add a single polygon collider to them once you import them to Unity. I was looking for a way to avoid this since I’m just prototyping right now, and the composite collider method works for that.

I also found this question in which the person who answers says that one can use a polygon collider to achieve similar results.

Think you are looking for this:

I don’t know if it works in 2D space, but have no reason to think that it wouldn’t.