fn velocity_system(time: Res<Time>, mut velocity_query: Query<&mut Velocity>) {
    let delta = time.delta_seconds();

    for mut velocity in velocity_query.iter_mut() {
        velocity.translation += Vec3::new(0.0, GRAVITY * delta, 0.0);
    }
}
/// Applies gravity to all entities with velocity
Applies gravity to all entities with velocity
Applies gravity to all entities with velocity
fn velocity_system(time: Res<Time>, mut velocity_query: Query<&mut Velocity>) {
    let delta = time.delta_seconds();
    for mut velocity in velocity_query.iter_mut() {
        velocity.translation += Vec3::new(0.0, GRAVITY * delta, 0.0);
    }
}
fn velocity_system ( time : Res < Time > , mut velocity_query : Query < & mut Velocity > ) { let delta = time . delta_seconds ( ) ; for mut velocity in velocity_query . iter_mut ( ) { velocity . translation += Vec3 :: new ( 0.0 , GRAVITY * delta , 0.0 ) ; } }
Applies gravity to all entities with velocity
Applies gravity to all entities with velocity
time
Res<Time>
velocity_query
Query<&mut Velocity>
time
Res<Time>
velocity_query
Query<&mut Velocity>