Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/bevy_camera_controller/src/free_cam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,18 @@ pub fn run_freecam_controller(
controller.initialized = true;
info!("{}", *controller);
}

if !controller.enabled {
// don't keep the cursor grabbed if the controller was disabled.
if *toggle_cursor_grab || *mouse_cursor_grab {
*toggle_cursor_grab = false;
*mouse_cursor_grab = false;

for (_, mut cursor_options) in &mut windows {
cursor_options.grab_mode = CursorGrabMode::None;
cursor_options.visible = true;
}
}
return;
}

Expand Down