diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 6e86c9ff025..9ab1f74f4f8 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -312,6 +312,7 @@ void PathFollow2D::_bind_methods() { } void PathFollow2D::set_offset(float p_offset) { + ERR_FAIL_COND(!isfinite(p_offset)); offset = p_offset; if (path) { if (path->get_curve().is_valid()) { diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index be3118ede06..a77e5812363 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -320,6 +320,7 @@ void PathFollow::_bind_methods() { } void PathFollow::set_offset(float p_offset) { + ERR_FAIL_COND(!isfinite(p_offset)); delta_offset = p_offset - offset; offset = p_offset;