Clamp PathFollow3D progress when not looping

This commit is contained in:
Raul Santos 2023-06-15 13:49:52 +02:00
parent c0d8d91b15
commit 0b4ec4027c
No known key found for this signature in database
GPG Key ID: B532473AE3A803E4
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}
}