Is it possible for a RigidBody to have colliders that are not direct children?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Aaron Franke

I’m trying to build compound colliders out of CollisionShape. I’d like to have several of these together as children of a child so that I can easily remove/generate/instance them as needed.


However, only Collider0 is detected, without it the Rigidbody complains that it has no collider. It seems that I can only have colliders that are direct children?

Is there any way for the RigidBody to detect Colliders 1-4 in this configuration? If not I’ll have to use groups or something else to organize and manage them.

:bust_in_silhouette: Reply From: eons

In short, no.

Bodies need shapes, and those are normally owned by the CollisionShape nodes which need to be direct children of the body.

What you can do, if you need a tree structure, is to make custom nodes that draws the shape on editor, then build that structure with the real collision shapes at runtime.

It may be possible to not use CollisionShape nodes at all (like using your own custom owner or none), but I do not understand how the shape owner system works…