remove redundant cursor locking
This commit is contained in:
parent
2f798e5cbc
commit
581ce65cd6
1 changed files with 0 additions and 6 deletions
|
@ -61,14 +61,8 @@ fn update_player_mouse(
|
|||
|
||||
fn update_player_keyboard(
|
||||
keyboard: Res<ButtonInput<KeyCode>>,
|
||||
mut window: Query<&mut Window, With<PrimaryWindow>>,
|
||||
mut players: Query<(&mut LinearVelocity, &Transform), (With<PlayerController>, With<RigidBody>)>,
|
||||
) {
|
||||
if let Ok(mut window) = window.get_single_mut() {
|
||||
window.cursor.grab_mode = CursorGrabMode::Locked;
|
||||
window.cursor.visible = false;
|
||||
}
|
||||
|
||||
let mut direction = Vec3::ZERO;
|
||||
direction += keyboard.pressed(KeyCode::KeyW).then_some(-Vec3::Z).unwrap_or_default();
|
||||
direction += keyboard.pressed(KeyCode::KeyS).then_some(Vec3::Z).unwrap_or_default();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue