diff --git a/src/world.rs b/src/world.rs index 6124007..cec5bce 100644 --- a/src/world.rs +++ b/src/world.rs @@ -455,15 +455,16 @@ fn handle_cheats( // This avoids rendering glitches when very far away from the origin. pub fn position_to_transform( q_player: Query<&Position, With>, - mut q_trans: Query<(&'static mut Transform, &'static Position), Without>, + mut q_trans: Query<(&'static mut Transform, &'static Position, &'static Rotation), Without>, ) { if let Ok(player_pos) = q_player.get_single() { - for (mut transform, pos) in &mut q_trans { + for (mut transform, pos, rot) in &mut q_trans { transform.translation = Vec3::new( (pos.x - player_pos.x) as f32, (pos.y - player_pos.y) as f32, (pos.z - player_pos.z) as f32, ); + transform.rotation = rot.as_quat(); } } }