ソースを参照

Fix `GridMap` shortcuts being triggered during freelook (mouse captured)

Robert Yevdokimov 7 ヶ月 前
コミット
943eed575b
1 ファイル変更3 行追加1 行削除
  1. 3 1
      modules/gridmap/editor/grid_map_editor_plugin.cpp

+ 3 - 1
modules/gridmap/editor/grid_map_editor_plugin.cpp

@@ -674,7 +674,9 @@ void GridMapEditor::_show_viewports_transform_gizmo(bool p_value) {
 }
 
 EditorPlugin::AfterGUIInput GridMapEditor::forward_spatial_input_event(Camera3D *p_camera, const Ref<InputEvent> &p_event) {
-	if (!node) {
+	// If the mouse is currently captured, we are most likely in freelook mode.
+	// In this case, disable shortcuts to avoid conflicts with freelook navigation.
+	if (!node || Input::get_singleton()->get_mouse_mode() == Input::MOUSE_MODE_CAPTURED) {
 		return EditorPlugin::AFTER_GUI_INPUT_PASS;
 	}