From cbb9d21fd0d1249fb9a02099d883bee54c74922a Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Sat, 30 Sep 2023 22:35:38 +0200 Subject: [PATCH] Fix NavigationObstacle3D debug being affected by rotation and scale Fixes NavigationObstacle3D debug being affected by rotation and scale. --- scene/3d/navigation_obstacle_3d.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scene/3d/navigation_obstacle_3d.cpp b/scene/3d/navigation_obstacle_3d.cpp index df6dd99aacd..aadec04ce5e 100644 --- a/scene/3d/navigation_obstacle_3d.cpp +++ b/scene/3d/navigation_obstacle_3d.cpp @@ -148,10 +148,14 @@ void NavigationObstacle3D::_notification(int p_what) { } #ifdef DEBUG_ENABLED if (fake_agent_radius_debug_instance.is_valid() && radius > 0.0) { - RS::get_singleton()->instance_set_transform(fake_agent_radius_debug_instance, get_global_transform()); + Transform3D debug_transform; + debug_transform.origin = get_global_position(); + RS::get_singleton()->instance_set_transform(fake_agent_radius_debug_instance, debug_transform); } if (static_obstacle_debug_instance.is_valid() && get_vertices().size() > 0) { - RS::get_singleton()->instance_set_transform(static_obstacle_debug_instance, get_global_transform()); + Transform3D debug_transform; + debug_transform.origin = get_global_position(); + RS::get_singleton()->instance_set_transform(static_obstacle_debug_instance, debug_transform); } #endif // DEBUG_ENABLED }