[Rapier] [3D] Is it possible to have a collider attached directly to a RigidBody? #22912
-
Beta Was this translation helpful? Give feedback.
Answered by
ThibaultLemaire
Feb 11, 2026
Replies: 1 comment
-
|
Upon further investigation, the issue turns out not to be with colliders, but simply with attaching a So this is my new code: fn make_tiles_interactible(
mut commands: Commands,
tiles: Query<(&Children, &Transform), With<Tile>>,
) {
for (meshes, parent_transform) in tiles {
commands
.entity(
*meshes
.first()
.expect("A tile has a single child and that is its mesh"),
)
// Unparent and copy parent transform because Rapier is very confused when a RigidBody's parent as a non-zero transform
.remove::<ChildOf>()
.insert((
RigidBody::Dynamic,
*parent_transform,
ConvexHullCollider { remove_mesh: false },
));
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ThibaultLemaire
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Upon further investigation, the issue turns out not to be with colliders, but simply with attaching a
RigidBodyto a child of an entity with a non-zeroTransform...So this is my new code: