/// 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 q: Query<Mut<Velocity>>) {
    let delta = time.delta_seconds();
    for mut v in q.iter_mut() {
        v.translation += Vec3::new(0.0, GRAVITY * delta, 0.0);
    }
}
fn velocity_system ( time : Res < Time > , mut q : Query < Mut < Velocity > > ) { let delta = time . delta_seconds ( ) ; for mut v in q . iter_mut ( ) { v . 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>
q
Query<Mut<Velocity>>