Skip to content
Discussion options

You must be logged in to vote

Upon further investigation, the issue turns out not to be with colliders, but simply with attaching a RigidBody to a child of an entity with a non-zero Transform...

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>()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ThibaultLemaire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant