proper for loop
This commit is contained in:
parent
edc9b376b9
commit
0803b9d611
1 changed files with 2 additions and 2 deletions
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue