From 0b4ec4027ccff94a055d82d6c7a6740786b4c583 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Thu, 15 Jun 2023 13:49:52 +0200 Subject: [PATCH] Clamp PathFollow3D progress when not looping --- scene/3d/path_3d.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp index c71f80ea0e4..9516973ae2a 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); } }