From d2e7ced27bd13978534a75341d35e6c1c53ad47b Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 3 Sep 2023 08:45:25 +0200 Subject: [PATCH] Backported from godot4: Fix NavigationRegion3D debug mesh rendering twice in Editor Fixes double rendering of NavigationRegion3D debug mesh due to both 3DGizmo and runtime debug rendering the mesh at the same time. - smix8 https://github.com/godotengine/godot/commit/0e4c31ce57443d03a7d223618760998ad807def6 --- scene/3d/navigation_mesh_instance.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene/3d/navigation_mesh_instance.cpp b/scene/3d/navigation_mesh_instance.cpp index fa24d4155..9ada906fb 100644 --- a/scene/3d/navigation_mesh_instance.cpp +++ b/scene/3d/navigation_mesh_instance.cpp @@ -467,6 +467,12 @@ NavigationMeshInstance::~NavigationMeshInstance() { #ifdef DEBUG_ENABLED void NavigationMeshInstance::_update_debug_mesh() { + if (Engine::get_singleton()->is_editor_hint()) { + // don't update inside Editor as node 3d gizmo takes care of this + // as collisions and selections for Editor Viewport need to be updated + return; + } + if (!NavigationServer::get_singleton()->get_debug_navigation_enabled()) { if (debug_instance.is_valid()) { RS::get_singleton()->instance_set_visible(debug_instance, false);