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.  # Solution Use `despawn` instead. Co-authored-by: Devil Ira <justthecooldude@gmail.com>
This commit is contained in:
parent
2f4cf76866
commit
5fd628ebd3
@ -179,7 +179,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>, mut game: ResMu
|
||||
// remove all entities that are not a camera
|
||||
fn teardown(mut commands: Commands, entities: Query<Entity, Without<Camera>>) {
|
||||
for entity in &entities {
|
||||
commands.entity(entity).despawn_recursive();
|
||||
commands.entity(entity).despawn();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user