From 075c5e68f3ab538477e1fac18e93718c4942c9be Mon Sep 17 00:00:00 2001 From: Zhenyuan Zhang Date: Sat, 18 Dec 2021 23:53:50 -0500 Subject: [PATCH] Use despawn_recursive when removing children in the hierarchy example. --- examples/ecs/hierarchy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ecs/hierarchy.rs b/examples/ecs/hierarchy.rs index e3f4e36dd72e5..7de8f8d4b872d 100644 --- a/examples/ecs/hierarchy.rs +++ b/examples/ecs/hierarchy.rs @@ -107,7 +107,7 @@ fn rotate( // seconds if time.seconds_since_startup() >= 2.0 && children.len() == 3 { let child = children.last().copied().unwrap(); - commands.entity(child).despawn(); + commands.entity(child).despawn_recursive(); } if time.seconds_since_startup() >= 4.0 {