Skip to content

Commit d9a881b

Browse files
committed
Merge pull request godotengine#89009 from smix8/navobstacle_debug_visibility
Fix NavigationObstacle3D debug not reacting to visiblity changes
2 parents 7900597 + 785b5f4 commit d9a881b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scene/3d/navigation_obstacle_3d.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,19 @@ void NavigationObstacle3D::_notification(int p_what) {
132132
NavigationServer3D::get_singleton()->obstacle_set_paused(obstacle, !can_process());
133133
} break;
134134

135+
#ifdef DEBUG_ENABLED
136+
case NOTIFICATION_VISIBILITY_CHANGED: {
137+
if (is_inside_tree()) {
138+
if (fake_agent_radius_debug_instance.is_valid()) {
139+
RS::get_singleton()->instance_set_visible(fake_agent_radius_debug_instance, is_visible_in_tree());
140+
}
141+
if (static_obstacle_debug_instance.is_valid()) {
142+
RS::get_singleton()->instance_set_visible(static_obstacle_debug_instance, is_visible_in_tree());
143+
}
144+
}
145+
} break;
146+
#endif // DEBUG_ENABLED
147+
135148
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
136149
if (is_inside_tree()) {
137150
_update_position(get_global_transform().origin);

0 commit comments

Comments
 (0)