Silly question about Rigidbody and multiple colliders.

I think I just might have spent way too much time trying to setup my current project on a flawed assumption.

Can multiple colliders within the same rigidbody collide with each other?
I was playing around with the idea of having a parent gameobject with a rigidbody2d and a composite collider 2d. Beneath that would be a series of instantiated child objects, each with their own 2d collider - set to NOT be used by the composite.

The concept is to try to overlap the moving child objects in a specific order, freezing the child objects in order with player input. And in turn, if collision was detected, turn “used in composite” true on that specifc child object.

I didn’t manage to get the collision to occur at all, so I’m imagining my reasoning about this might have been wrong some how?

No, sibling colliders never collide. Only colliders on different Rigidbody2D can come into contact. You have to understand that colliders in themselves don’t actually move, only Rigidbody2D do and colliders attached to them are along for the ride. This means that they can never ever physically contact each other anyway.

Sure, you can bypass physics and change their positions directly with the Transform (you shouldn’t ever do this) but that’s not physical movement.

I see. :frowning: Too bad. Back to the drawing table then.
Thanks for the enlightenment. :slight_smile:

You can just add separate Rigidbody2D for these things, it costs very little, especially if they are Kinematic or Static.

Given what you described, I don’t see why they must be children or be in a permanent place in a hierarchy. You can place them in the scene, detect collisions then reparent their GameObject into the hierarchy where the composite is if you want to merge them for some reason.