make mouse rotate more reliable

This commit is contained in:
2025-03-16 13:43:01 +01:00
parent 8335d5fab4
commit 8cadb670b7
2 changed files with 3 additions and 6 deletions

View File

@@ -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) {