From 0fdda75fdce5cb52d7fd55ede8d2c8228e40cd80 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 29 Sep 2022 14:39:14 +0800 Subject: [PATCH] Fix NavigationObstacle not estimating radius (cherry picked from commit acf86efebc40317baceb52018270d04e33d8cbcc) --- scene/3d/navigation_obstacle.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scene/3d/navigation_obstacle.cpp b/scene/3d/navigation_obstacle.cpp index 027f803905c..ed3a5911490 100644 --- a/scene/3d/navigation_obstacle.cpp +++ b/scene/3d/navigation_obstacle.cpp @@ -216,12 +216,11 @@ real_t NavigationObstacle::estimate_agent_radius() const { } Vector3 s = parent_spatial->get_global_transform().basis.get_scale(); radius *= MAX(s.x, MAX(s.y, s.z)); - } - if (radius > 0.0) { - return radius; + if (radius > 0.0) { + return radius; + } } - return 1.0; // Never a 0 radius }