diff --git a/src/camera.rs b/src/camera.rs index 22cba50..5b8d726 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -151,14 +151,16 @@ pub fn sync_camera_to_player( let (actor, player_transform) = q_playercam.get_single().unwrap(); // Rotation - camera_transform.rotation = player_transform.rotation * Quat::from_array([0.0, -1.0, 0.0, 0.0]); + let rotation = player_transform.rotation * Quat::from_array([0.0, -1.0, 0.0, 0.0]); // Translation if settings.third_person { - camera_transform.translation = player_transform.translation + camera_transform.rotation * (actor.camdistance * Vec3::new(0.0, 0.2, 1.0)); + camera_transform.translation = player_transform.translation + rotation * (actor.camdistance * Vec3::new(0.0, 0.2, 1.0)); + camera_transform.rotation = rotation * Quat::from_euler(EulerRot::XYZ, -0.02, 0.0, 0.0); } else { camera_transform.translation = player_transform.translation; + camera_transform.rotation = rotation; } }