fn rotator_system(time: Res<Time>, mut query: Query<(&Rotator, &mut Transform)>) {
    for (_rotator, mut transform) in &mut query.iter() {
        transform.rotate(Quat::from_rotation_z(2.0 * time.delta_seconds));
        transform.translate(Vec3::new(10.0, 0.0, 0.0));
        transform.apply_scale(1.0 - (time.delta_seconds / 5.0));
    }
}
/// rotates the parent, which will result in the child also rotating
rotates the parent, which will result in the child also rotating
rotates the parent which will result in the child also rotating
fn rotator_system(time: Res<Time>, mut query: Query<(&Rotator, &mut Transform)>) {
    for (_rotator, mut transform) in &mut query.iter() {
        transform.rotate(Quat::from_rotation_z(2.0 * time.delta_seconds));
        transform.translate(Vec3::new(10.0, 0.0, 0.0));
        transform.apply_scale(1.0 - (time.delta_seconds / 5.0));
    }
}
fn rotator_system ( time : Res < Time > , mut query : Query < ( & Rotator , & mut Transform ) > ) { for ( _rotator , mut transform ) in & mut query . iter ( ) { transform . rotate ( Quat :: from_rotation_z ( 2.0 * time . delta_seconds ) ) ; transform . translate ( Vec3 :: new ( 10.0 , 0.0 , 0.0 ) ) ; transform . apply_scale ( 1.0 - ( time . delta_seconds / 5.0 ) ) ; } }
rotates the parent, which will result in the child also rotating
rotates the parent which will result in the child also rotating
time
Res<Time>
query
Query<(&Rotator, &mut Transform)>
time
Res<Time>
query
Query<(&Rotator, &mut Transform)>