summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmix8 <52464204+smix8@users.noreply.github.com>2022-08-09 11:05:47 +0200
committersmix8 <52464204+smix8@users.noreply.github.com>2022-08-09 11:59:31 +0200
commit8bfea7dcb46b0a566bf1de7caa40533f29774e91 (patch)
tree2c67cf46a9489ba8e538d15866789af941c8a978
parentc2eaaef1497f8ad557aea9a14e2b3e0582fcfe54 (diff)
Fix Editor Navigation debug edge connection visuals
Fixes missing Navigation debug edge connection visuals in Editor due to disabled NavigationServer.
-rw-r--r--servers/navigation_server_3d.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/servers/navigation_server_3d.cpp b/servers/navigation_server_3d.cpp
index 52855c5931..115eda7b30 100644
--- a/servers/navigation_server_3d.cpp
+++ b/servers/navigation_server_3d.cpp
@@ -123,6 +123,12 @@ NavigationServer3D::NavigationServer3D() {
debug_navigation_enable_edge_lines = GLOBAL_DEF("debug/shapes/navigation/enable_edge_lines", true);
debug_navigation_enable_edge_lines_xray = GLOBAL_DEF("debug/shapes/navigation/enable_edge_lines_xray", true);
debug_navigation_enable_geometry_face_random_color = GLOBAL_DEF("debug/shapes/navigation/enable_geometry_face_random_color", 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
}