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
0e4c31ce57
This commit is contained in:
Relintai 2023-09-03 08:45:25 +02:00
parent 6ff5c5f7f3
commit d2e7ced27b

View File

@ -467,6 +467,12 @@ NavigationMeshInstance::~NavigationMeshInstance() {
#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
void NavigationMeshInstance::_update_debug_mesh() { 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 (!NavigationServer::get_singleton()->get_debug_navigation_enabled()) {
if (debug_instance.is_valid()) { if (debug_instance.is_valid()) {
RS::get_singleton()->instance_set_visible(debug_instance, false); RS::get_singleton()->instance_set_visible(debug_instance, false);