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)>,