Skip to content

Commit 5fd628e

Browse files
committed
Fix Alien Cake Addict example despawn warnings (#7236)
# Problem The example's `teardown` system despawns all entities besides the camera using `despawn_recursive` causing it to despawn child entities multiple times which logs a warning. ![image](https://user-images.githubusercontent.com/29694403/212756554-06b3fa42-ddcb-4a05-b841-f587488a10fc.png) # Solution Use `despawn` instead. Co-authored-by: Devil Ira <[email protected]>
1 parent 2f4cf76 commit 5fd628e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/games/alien_cake_addict.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>, mut game: ResMu
179179
// remove all entities that are not a camera
180180
fn teardown(mut commands: Commands, entities: Query<Entity, Without<Camera>>) {
181181
for entity in &entities {
182-
commands.entity(entity).despawn_recursive();
182+
commands.entity(entity).despawn();
183183
}
184184
}
185185

0 commit comments

Comments
 (0)