proper for loop

This commit is contained in:
Zynh Ludwig 2024-09-01 15:14:47 -07:00
parent edc9b376b9
commit 0803b9d611

View file

@ -26,9 +26,9 @@ struct BoidBundle {
} }
fn move_boids(mut boids: Query<(&mut Transform, &Velocity), With<Boid>>, time: Res<Time>) { fn move_boids(mut boids: Query<(&mut Transform, &Velocity), With<Boid>>, time: Res<Time>) {
boids.iter_mut().for_each(|(mut transform, velocity)| { for (mut transform, velocity) in &mut boids {
transform.translation += velocity.0 * time.delta_seconds(); transform.translation += velocity.0 * time.delta_seconds();
}); }
} }
fn setup( fn setup(