diff --git a/core/math/math_2d.h b/core/math/math_2d.h index 8928349a448..cdfd90747b1 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -304,7 +304,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) {