diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index 33bf691b8c7..66b5a28d1a2 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -412,7 +412,7 @@ real_t NavigationPolygonInstance::get_enter_cost() const { void NavigationPolygonInstance::set_travel_cost(real_t p_travel_cost) { ERR_FAIL_COND_MSG(p_travel_cost < 0.0, "The travel_cost must be positive."); travel_cost = MAX(p_travel_cost, 0.0); - Navigation2DServer::get_singleton()->region_set_enter_cost(region, travel_cost); + Navigation2DServer::get_singleton()->region_set_travel_cost(region, travel_cost); } real_t NavigationPolygonInstance::get_travel_cost() const { diff --git a/scene/3d/navigation_mesh_instance.cpp b/scene/3d/navigation_mesh_instance.cpp index 29700273336..f26aace1843 100644 --- a/scene/3d/navigation_mesh_instance.cpp +++ b/scene/3d/navigation_mesh_instance.cpp @@ -94,7 +94,7 @@ real_t NavigationMeshInstance::get_enter_cost() const { void NavigationMeshInstance::set_travel_cost(real_t p_travel_cost) { ERR_FAIL_COND_MSG(p_travel_cost < 0.0, "The travel_cost must be positive."); travel_cost = MAX(p_travel_cost, 0.0); - NavigationServer::get_singleton()->region_set_enter_cost(region, travel_cost); + NavigationServer::get_singleton()->region_set_travel_cost(region, travel_cost); } real_t NavigationMeshInstance::get_travel_cost() const {