navigation_debug_tools.rst 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. .. _doc_navigation_debug_tools:
  2. Navigation Debug Tools
  3. ======================
  4. .. note::
  5. The debug tools, properties and functions are only available in Godot debug builds.
  6. Do not use any of them in code that will be part of a release build.
  7. Enabling debug navigation
  8. -------------------------
  9. The navigation debug visualization is enabled by default inside the Editor.
  10. To visualize navigation meshes and connections also at runtime
  11. enable the option ``Visible Navigation`` in the editor debug menu.
  12. .. image:: img/navigation_debug_toggle.png
  13. In Godot debug builds the navigation debug can also be toggled on the NavigationServers from scripts.
  14. .. tabs::
  15. .. code-tab:: gdscript GDScript
  16. NavigationServer2D.set_debug_enabled(false)
  17. NavigationServer3D.set_debug_enabled(true)
  18. Debug navigation settings
  19. -------------------------
  20. The appearance of navigation debug can be change in the ProjectSettings under ``debug/shapes/navigation``.
  21. Certain debug features can also be enabled or disabled at will but may require a scene restart to apply.
  22. .. image:: img/nav_debug_settings.png
  23. Debug navigation mesh polygons
  24. ------------------------------
  25. If ``enable_edge_lines`` is enabled the edges of navigation mesh polygons will be highlighted.
  26. If ``enable_edge_lines_xray`` is also enabled the edges of navigationmeshes will be visible through geometry.
  27. if ``enable_geometry_face_random_color`` is enabled each navigation mesh face receives
  28. a random color that is mixed with the main color from ``geometry_face_color``.
  29. .. image:: img/nav_debug_xray_edge_lines.png
  30. Debug edge connections
  31. ----------------------
  32. Different navigation meshes connected within ``edge_connection_margin`` distance are overlaid.
  33. The color of the overlay is controlled with the navigation debug ``edge_connection_color``.
  34. The connections can be made visible through geometry with the navigation debug ``enable_edge_connections_xray`` property.
  35. .. image:: img/nav_edge_connection2d.gif
  36. .. image:: img/nav_edge_connection3d.gif
  37. .. note::
  38. Edge connections are only visible when the NavigationServer is active.