Skip to content

Collider to multiple rigid bodies, how? #564

Answered by sebcrozet
ThomasCartier asked this question in Q&A
Discussion options

You must be logged in to vote

It is not possible to attach a single collider to the same rigid-body. The code snippet your provide are actually creating two distinct colliders with the same shape, attached to two distinct rigid-body. It looks like you are trying to have the one rigid-body’s motion constrained based on the motion of another rigid-body. To achieve that, you can attach the two rigid-bodies with a constraint like a FixedJoint.

Another (more efficient and numerically robust) option is to only have a single rigid-body and attach the two ball colliders to that rigid-body. But of cours, this means you don’t get one rigid-body per ball (which might or might not be an issue depending on your use-case).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ThomasCartier
Comment options

Answer selected by ThomasCartier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants