From 15781d2175e9cbff98ed65ac2c9a5f108d538870 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 30 Mar 2024 18:56:24 +0100 Subject: [PATCH] fix flicker when toggling 3rd person camera --- src/actor.rs | 1 + src/camera.rs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actor.rs b/src/actor.rs index 4087c98..53cba23 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -309,6 +309,7 @@ pub fn handle_vehicle_enter_exit( if event.is_entering { // Entering Vehicle commands.entity(driver).remove::(); + *driver_vis = Visibility::Hidden; //seems to have no effect... if event.is_player { ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::EnterVehicle)); commands.entity(driver).remove::(); diff --git a/src/camera.rs b/src/camera.rs index 0a659b7..8f6963b 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -14,7 +14,7 @@ impl Plugin for CameraControllerPlugin { fn build(&self, app: &mut App) { app.add_systems(Startup, setup_camera); app.add_systems(Update, handle_input); - app.add_systems(Update, manage_player_actor); + app.add_systems(Update, manage_player_actor.after(handle_input)); app.add_systems(PostUpdate, sync_camera_to_player .after(PhysicsSet::Sync) .before(TransformSystem::TransformPropagate)); @@ -93,7 +93,6 @@ pub fn handle_input( } fn manage_player_actor( - mut commands: Commands, settings: Res, mut q_playercam: Query<&mut Visibility, With>, mut q_hiddenplayer: Query<&mut Visibility, (With, Without)>,