Adding a collider between bones. Using a mesh or a composite collider?

Hello!
So I have two rows of bones and I want to dectect if anything passes between them.


Could I use an empty with a Composite collider?
I just cannot seem to find any documentation about how to set the Elements of a composite collider. So I could set the elements to the position of the bones.

Or should I generate a mesh with each bone adding a new tri to the mesh, then put a composite collider onto it.
Also the bones can move, could I dynamically transform the collider or the mesh? (It’s not necessary, but would be nice). Anyway to to detect if something is between the two rows of bones could work.

I wish you all a nice day!

You can’t find documentation for abilities that don’t exist.

As the synopsis in the docs state, the CompositeCollider2D is “A Collider that can merge other Colliders together.” so if you have multilple colliders, it can merge their geometry. No idea why you think using this is the answer though, it certainly doesn’t sound like a good idea having so many colliders which also have to have a Rigidbody2D if they move independantly (colliders don’t move, Rigidbody2D do).

The EdgeCollider2D is a single collider that is comprised of (unsurprisingly) multiple edges so just use that unless of course there’s other requirements which you left out of your post. An EdgeCollider2D forms a continuous set of edges, you can even set an edge radius so each edge effectively acts like a capsule shape.

In-case you’re not aware of them, this really sounds like a post better sutied to the 2D or Physics sub-forums.

1 Like