diff --git a/src/camera.rs b/src/camera.rs index d36bcd8..09ce3b1 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -4,6 +4,8 @@ use bevy::window::PrimaryWindow; use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings}; use bevy::core_pipeline::tonemapping::Tonemapping; use bevy_xpbd_3d::prelude::*; +use bevy_xpbd_3d::PhysicsSchedule; +use bevy_xpbd_3d::PhysicsStepSet; use std::f32::consts::*; use crate::{settings, audio, actor}; @@ -14,7 +16,7 @@ impl Plugin for CameraControllerPlugin { app.add_systems(Startup, setup_camera); app.add_systems(Update, handle_input); app.add_systems(Update, manage_player_actor); - app.add_systems(Update, sync_camera_to_player); + app.add_systems(PhysicsSchedule, sync_camera_to_player.in_set(PhysicsStepSet::BroadPhase)); app.add_systems(Update, update_fov); app.add_systems(Update, apply_input_to_player); }