Skip to content

Commit

Permalink
Clamp PathFollow3D progress when not looping
Browse files Browse the repository at this point in the history
  • Loading branch information
raulsntos committed Jun 15, 2023
1 parent c0d8d91 commit 0b4ec40
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 0b4ec40

Please sign in to comment.