From 785b5f4574a0c182dc7df7fd14bd6554800cbabe Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:27:10 +0100 Subject: [PATCH] Fix NavigationObstacle3D debug not reacting to visiblity changes Fixes NavigationObstacle3D debug not reacting to visiblity changes. --- scene/3d/navigation_obstacle_3d.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scene/3d/navigation_obstacle_3d.cpp b/scene/3d/navigation_obstacle_3d.cpp index 82450927d38..96f7fb137c3 100644 --- a/scene/3d/navigation_obstacle_3d.cpp +++ b/scene/3d/navigation_obstacle_3d.cpp @@ -132,6 +132,19 @@ void NavigationObstacle3D::_notification(int p_what) { NavigationServer3D::get_singleton()->obstacle_set_paused(obstacle, !can_process()); } break; +#ifdef DEBUG_ENABLED + case NOTIFICATION_VISIBILITY_CHANGED: { + if (is_inside_tree()) { + if (fake_agent_radius_debug_instance.is_valid()) { + RS::get_singleton()->instance_set_visible(fake_agent_radius_debug_instance, is_visible_in_tree()); + } + if (static_obstacle_debug_instance.is_valid()) { + RS::get_singleton()->instance_set_visible(static_obstacle_debug_instance, is_visible_in_tree()); + } + } + } break; +#endif // DEBUG_ENABLED + case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { if (is_inside_tree()) { _update_position(get_global_transform().origin);