use unwrap

This commit is contained in:
luckyturtledev 2024-07-10 17:27:22 +02:00
parent 889b175daf
commit edfb0be3c6

View file

@ -43,10 +43,8 @@ fn move_player(
direction.x -= 1.0; direction.x -= 1.0;
} }
if direction != Vec3::ZERO { if direction != Vec3::ZERO {
if let Ok(mut player_transform) = q_player.get_single_mut() { let mut player_transform = q_player.get_single_mut().unwrap();
player_transform.translation += player_transform.translation += direction.normalize() * PLAYER_SPEED * time.delta_seconds();
direction.normalize() * PLAYER_SPEED * time.delta_seconds();
}
} }
} }