diff --git a/core/math/math_2d.h b/core/math/math_2d.h index 02d921b67e27..e7188da85b9b 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -303,7 +303,7 @@ struct Rect2 { inline real_t distance_to(const Vector2 &p_point) const { - real_t dist; + real_t dist = 0.0; bool inside = true; if (p_point.x < position.x) {