Skip to content

Commit

Permalink
Merge pull request #89009 from smix8/navobstacle_debug_visibility
Browse files Browse the repository at this point in the history
Fix NavigationObstacle3D debug not reacting to visiblity changes
  • Loading branch information
akien-mga committed Mar 1, 2024
2 parents 7900597 + 785b5f4 commit d9a881b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scene/3d/navigation_obstacle_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d9a881b

Please sign in to comment.