reset look around cam properly
This commit is contained in:
@@ -2,10 +2,7 @@ use avian3d::prelude::*;
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::{
|
||||
GameState,
|
||||
control::{ControlState, controller_common::PlayerMovement},
|
||||
loading_assets::UIAssets,
|
||||
physics_layers::GameLayer,
|
||||
GameState, control::ControlState, loading_assets::UIAssets, physics_layers::GameLayer,
|
||||
};
|
||||
|
||||
#[derive(Component, Reflect, Debug)]
|
||||
@@ -152,16 +149,9 @@ fn update(
|
||||
*cam_transform = Transform::from_translation(cam_pos).looking_at(target, Vec3::Y);
|
||||
}
|
||||
|
||||
fn rotate_view(
|
||||
controls: Res<ControlState>,
|
||||
mut cam: Single<&mut CameraRotationInput>,
|
||||
movement: Res<PlayerMovement>,
|
||||
) {
|
||||
fn rotate_view(controls: Res<ControlState>, mut cam: Single<&mut CameraRotationInput>) {
|
||||
if !controls.view_mode {
|
||||
if movement.any_direction {
|
||||
cam.x = 0.;
|
||||
}
|
||||
|
||||
cam.x = 0.;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user