From 3f656924e1e4a44afc7c763875bec6966792782d Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 30 Mar 2024 16:52:22 +0100 Subject: [PATCH] non-shaky camera updates (especially while moving fast) --- src/camera.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }