Merge pull request #60321 from rburing/pathfollow_offset_yes_a_number
This commit is contained in:
commit
1737494479
|
@ -311,7 +311,7 @@ void PathFollow2D::set_offset(real_t p_offset) {
|
|||
if (path->get_curve().is_valid()) {
|
||||
real_t path_length = path->get_curve()->get_baked_length();
|
||||
|
||||
if (loop) {
|
||||
if (loop && path_length) {
|
||||
offset = Math::fposmod(offset, path_length);
|
||||
if (!Math::is_zero_approx(p_offset) && Math::is_zero_approx(offset)) {
|
||||
offset = path_length;
|
||||
|
|
|
@ -310,7 +310,7 @@ void PathFollow3D::set_offset(real_t p_offset) {
|
|||
if (path->get_curve().is_valid()) {
|
||||
real_t path_length = path->get_curve()->get_baked_length();
|
||||
|
||||
if (loop) {
|
||||
if (loop && path_length) {
|
||||
offset = Math::fposmod(offset, path_length);
|
||||
if (!Math::is_zero_approx(p_offset) && Math::is_zero_approx(offset)) {
|
||||
offset = path_length;
|
||||
|
|
Loading…
Reference in New Issue