fix flicker when toggling 3rd person camera
This commit is contained in:
parent
3472be43b0
commit
15781d2175
|
@ -309,6 +309,7 @@ pub fn handle_vehicle_enter_exit(
|
||||||
if event.is_entering {
|
if event.is_entering {
|
||||||
// Entering Vehicle
|
// Entering Vehicle
|
||||||
commands.entity(driver).remove::<RigidBody>();
|
commands.entity(driver).remove::<RigidBody>();
|
||||||
|
*driver_vis = Visibility::Hidden; //seems to have no effect...
|
||||||
if event.is_player {
|
if event.is_player {
|
||||||
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::EnterVehicle));
|
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::EnterVehicle));
|
||||||
commands.entity(driver).remove::<PlayerCamera>();
|
commands.entity(driver).remove::<PlayerCamera>();
|
||||||
|
|
|
@ -14,7 +14,7 @@ impl Plugin for CameraControllerPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
app.add_systems(Startup, setup_camera);
|
app.add_systems(Startup, setup_camera);
|
||||||
app.add_systems(Update, handle_input);
|
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
|
app.add_systems(PostUpdate, sync_camera_to_player
|
||||||
.after(PhysicsSet::Sync)
|
.after(PhysicsSet::Sync)
|
||||||
.before(TransformSystem::TransformPropagate));
|
.before(TransformSystem::TransformPropagate));
|
||||||
|
@ -93,7 +93,6 @@ pub fn handle_input(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn manage_player_actor(
|
fn manage_player_actor(
|
||||||
mut commands: Commands,
|
|
||||||
settings: Res<settings::Settings>,
|
settings: Res<settings::Settings>,
|
||||||
mut q_playercam: Query<&mut Visibility, With<actor::PlayerCamera>>,
|
mut q_playercam: Query<&mut Visibility, With<actor::PlayerCamera>>,
|
||||||
mut q_hiddenplayer: Query<&mut Visibility, (With<actor::Player>, Without<actor::PlayerCamera>)>,
|
mut q_hiddenplayer: Query<&mut Visibility, (With<actor::Player>, Without<actor::PlayerCamera>)>,
|
||||||
|
|
Loading…
Reference in a new issue