summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scene/3d/path_3d.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp
index c71f80ea0e..9516973ae2 100644
--- a/scene/3d/path_3d.cpp
+++ b/scene/3d/path_3d.cpp
@@ -361,6 +361,8 @@ void PathFollow3D::set_progress(real_t p_progress) {
if (!Math::is_zero_approx(p_progress) && Math::is_zero_approx(progress)) {
progress = path_length;
}
+ } else {
+ progress = CLAMP(progress, 0, path_length);
}
}