NavigationObstacle2D: estimate agent radius only when configured to do so

This commit is contained in:
Ricardo Buring 2022-04-03 22:11:44 +02:00
parent a5f9e1ce18
commit 21580f94ad
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ void NavigationObstacle2D::initialize_agent() {
}
void NavigationObstacle2D::reevaluate_agent_radius() {
if (!estimate_agent_radius()) {
if (!estimate_radius) {
Navigation2DServer::get_singleton()->agent_set_radius(agent, radius);
} else if (parent_node2d && parent_node2d->is_inside_tree()) {
Navigation2DServer::get_singleton()->agent_set_radius(agent, estimate_agent_radius());