ITADN

Panic `Island IslandId(5) does not exist` after despawning hierarchical structure

#950Openeswartz 创建于 2026-03-06
C-BugA-DynamicsP-CrashS-Needs-Investigation
E
eswartzcommented
**Versions:** 0.6.0-rc1, 0.6.0-dev I was messing with a ragdoll simulation by using RigidBody and Collider on top of "bones", where those bones control a skinned `Mesh3d`. When tearing down the scene and the `"validate"` feature is active, I get a panic: ``` thread 'main' (4184859) panicked at /home/ejs/.cargo/git/checkouts/avian-5a22c167119f3550/4a92d33/crates/avian3d/../../src/dynamics/solver/islands/mod.rs:1403:48: Island IslandId(5) does not exist note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Encountered a panic when applying buffers for system `avian_island_bug::teardown`! Encountered a panic in system `Pipe(bevy_state::state::transitions::last_transition<avian_island_bug::ProgramState>, bevy_state::state::transitions::run_enter<avian_island_bug::ProgramState>)`! Encountered a panic in system `bevy_app::main_schedule::Main::run_main`! ``` Since I was curious about where the `validate` feature got enabled, I added some debug prints, changed the panic to `eprintln!`, and this seems to tell the story: ``` removed 344v0 -> IslandId(0) removed 345v0 -> IslandId(3) removed 346v0 -> IslandId(2) removed 349v0 -> IslandId(3) removed 352v0 -> IslandId(3) Island IslandId(3) does not exist 345v0 removed 357v0 -> IslandId(5) removed 360v0 -> IslandId(6) removed 386v0 -> IslandId(1) ``` **Repro** [avian-island-bug.zip](https://github.com/user-attachments/files/25782078/avian-island-bug.zip) When you run this, the behavior you will see is of a wildly stretched figure self-destructing (almost) but in the original project everything is quite stable. So that particularity of the behavior is not involved here, AFAICT. This is a stripped-down version of my project which (also) uses Bevy Skein to construct the scene from .glb metadata, uses some custom components (`BoneCollider`/`BoneColliderTail`) to determine how to create colliders. Then after a second it deletes the scene (`update` counts down before switching states). It seems like adding `Collider::capsule_endpoints` is important here (in `set_up_scene`).
0 条评论