From d434a1c4e5e7669780de3af809e1c260f9e51239 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 9 Jun 2023 08:55:21 +0200 Subject: [PATCH] Backported from godot4: Fix Editor Navigation debug edge connection visuals Fixes missing Navigation debug edge connection visuals in Editor due to disabled NavigationServer. - smix8 https://github.com/godotengine/godot/commit/8bfea7dcb46b0a566bf1de7caa40533f29774e91 --- servers/navigation_server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/servers/navigation_server.cpp b/servers/navigation_server.cpp index 57a3c0663..4be963a1f 100644 --- a/servers/navigation_server.cpp +++ b/servers/navigation_server.cpp @@ -37,6 +37,7 @@ #include "scene/resources/navigation_mesh.h" #ifdef DEBUG_ENABLED +#include "core/config/engine.h" #include "core/config/project_settings.h" #include "scene/resources/material.h" #endif @@ -167,6 +168,12 @@ NavigationServer::NavigationServer() { _debug_navigation_enable_geometry_face_random_color = GLOBAL_DEF("debug/shapes/navigation/enable_geometry_face_random_color", true); _debug_navigation_enable_link_connections = GLOBAL_DEF("debug/shapes/navigation/enable_link_connections", true); _debug_navigation_enable_link_connections_xray = GLOBAL_DEF("debug/shapes/navigation/enable_link_connections_xray", true); + + if (Engine::get_singleton()->is_editor_hint()) { + // enable NavigationServer3D when in Editor or else navmesh edge connections are invisible + // on runtime tests SceneTree has "Visible Navigation" set and main iteration takes care of this + set_debug_enabled(true); + } #endif // DEBUG_ENABLED }