Description
I was trying to create a minimal project for another problem an I came upon this.
The minimal example project is the example ui/text with those lines:
`struct Item {
max_time: f32,
time: f32,
}
fn add_items(mut commands: Commands) {
for _ in 0..1000 {
commands.spawn((Item {max_time: 1.0, time: 0.0}, ));
}
}
fn update_items(mut commands: Commands, time: Res, mut query: Query<(&mut Item, Entity)>) {
let mut num = 0;
for (mut item, e) in &mut query.iter() {
num += 1;
item.time += time.delta_seconds;
if item.time >= item.max_time {
commands.despawn(e);
}
}
println!("number of items : {}", num);
}`
After a while I get:
thread 'main' panicked at 'called
Result::unwrap()on an
Errvalue: NoSuchEntity', C:\Users\kakoeimon\.cargo\git\checkouts\bevy-f7ffde730c324c74\89a1d36\crates\bevy_ecs\src\system\commands.rs:75:36 note: run with
RUST_BACKTRACE=1environment variable to display a backtrace error: process didn't exit successfully:
target\debug\no_such_entity.exe(exit code: 101)
The minimal example project