make mouse rotate more reliable
This commit is contained in:
@@ -120,7 +120,7 @@ fn spawn(
|
||||
}
|
||||
|
||||
fn rotate_view(
|
||||
controls: Res<Controls>,
|
||||
mut controls: ResMut<Controls>,
|
||||
// todo: Put the player head as a child of the rig to avoid this mess:
|
||||
mut player: Query<&mut Transform, Or<(With<PlayerRig>, With<PlayerHead>)>>,
|
||||
) {
|
||||
@@ -131,6 +131,8 @@ fn rotate_view(
|
||||
tr.rotate_y(gamepad.look_dir.x * -0.001);
|
||||
}
|
||||
}
|
||||
|
||||
controls.keyboard_state.look_dir = Vec2::ZERO;
|
||||
}
|
||||
|
||||
fn toggle_grab_cursor(window: &mut Window) {
|
||||
|
||||
Reference in New Issue
Block a user