Browse Source

Clamp PathFollow3D progress when not looping

Raul Santos 2 năm trước cách đây
mục cha
commit
0b4ec4027c
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      scene/3d/path_3d.cpp

+ 2 - 0
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);
 			}
 		}