dimforge / dimforge/bevy_rapier

Child colliders added by a system seem not to be linked as children in Rapier

Open
#252 2 comments 4 reactions 0 assignees View on GitHub
A-Integration C-Bug D-Medium P-Medium S-not-started
Dominant language
Rust
Stars
1.6k
Forks
282
PR merge metrics
No merged PRs in 30d

Description

[Example gist](https://gist.github.com/ian-h-chamberlain/4a5d497e99b69ceae7de58d3c8eb8b52) (based on the existing `player_movement2` example)

In this example, pressing `Space` spawns new (unparented) colliders somewhere relative to the player transform, and pressing `Return` adds all unparented colliders as children of the player. Here is a brief recording of the example:

https://user-images.githubusercontent.com/11131775/187086662-0573b988-1f42-4241-9092-67a8792da3dd.mov

The main player collider does interact with the parentless colliders, (similar to if they were a Fixed Rigidbody, I think?), but once reparented, the colliders don't seem to interact with anything. Also, they are still colored as "parentless" by the debug renderer, which explains why their collisions are not impacting the parent's. This can be verified fairly easily with `RapierContext::collider_parent()` (none will be found even though there is a Rigidbody on the parent).

Is this expected behavior, or am I doing something wrong in my example? Maybe this is just a gap in the system change detection, and a system is needed that watches for `HierarchyEvent`s on the relevant components, or something like that?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.