mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
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 <justthecooldude@gmail.com>
This commit is contained in:
parent
2f4cf76866
commit
5fd628ebd3
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue