Skip to content

Commit

Permalink
Merge pull request #78280 from raulsntos/path-follow-3d-clamp
Browse files Browse the repository at this point in the history
Clamp `PathFollow3D` progress when not looping
  • Loading branch information
akien-mga committed Jun 16, 2023
2 parents 2ebe692 + 0b4ec40 commit c6d9139
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scene/3d/path_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit c6d9139

Please sign in to comment.