diff --git a/bevy_rapier2d/examples/testbed2.rs b/bevy_rapier2d/examples/testbed2.rs index 8a433e22..cbb3cf03 100644 --- a/bevy_rapier2d/examples/testbed2.rs +++ b/bevy_rapier2d/examples/testbed2.rs @@ -108,6 +108,7 @@ fn main() { ) .run_if(in_state(Examples::DebugToggle2)), ) + .add_systems(OnExit(Examples::DebugToggle2), cleanup) // // rope joint .add_systems( diff --git a/bevy_rapier3d/examples/testbed3.rs b/bevy_rapier3d/examples/testbed3.rs index 9ef38786..316d713e 100644 --- a/bevy_rapier3d/examples/testbed3.rs +++ b/bevy_rapier3d/examples/testbed3.rs @@ -106,6 +106,7 @@ fn main() { ) .run_if(in_state(Examples::DebugToggle3)), ) + .add_systems(OnExit(Examples::DebugToggle3), cleanup) // // despawn .init_resource::()