LYYQJZPLAFOUJU2HV6VIYEIYSXPBZYPFZLONR66QX4QV25KRBG4QC
fn update_velocity(
mut query: Query<(
&mut Movable,
Option<&mut movement_pointer::MovementDirection>,
)>,
time: Res<Time>,
) {
for (mut movable, maybe_pointer) in query.iter_mut() {
fn update_velocity(mut query: Query<&mut Movable>, time: Res<Time>) {
for mut movable in query.iter_mut() {
// If we have a movement pointer, update it
if let Some(mut pointer) = maybe_pointer {
pointer.0 = movable.velocity.normalize_or_zero();
pointer.1 = movable.velocity.length();
}