summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-12-11 12:18:53 +0100
committerGitHub <noreply@github.com>2020-12-11 12:18:53 +0100
commitdc589a64e6a8c320ae286e3fa8c9533b58a286ca (patch)
tree605896d8e8a7add338b59bddd6b229a4cf29fba2 /scene
parent32c06dfc8dbf4c3e29232b7dbccc6a34ba257027 (diff)
parentcd42e938fc76ad53a7cdc914727ac61434ec9b7e (diff)
Merge pull request #44279 from KoBeWi/unit_offset_or_something_idk
Fix PathFollow3D updating on unit_offset 0
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/path_3d.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp
index f25a64c567..ae6bbad8bf 100644
--- a/scene/3d/path_3d.cpp
+++ b/scene/3d/path_3d.cpp
@@ -94,10 +94,6 @@ void PathFollow3D::_update_transform(bool p_update_xyz_rot) {
return;
}
- if (delta_offset == 0) {
- return;
- }
-
float bl = c->get_baked_length();
if (bl == 0.0) {
return;
@@ -156,7 +152,7 @@ void PathFollow3D::_update_transform(bool p_update_xyz_rot) {
t.origin = pos;
- if (p_update_xyz_rot) { // Only update rotation if some parameter has changed - i.e. not on addition to scene tree
+ if (p_update_xyz_rot && delta_offset != 0) { // Only update rotation if some parameter has changed - i.e. not on addition to scene tree.
Vector3 t_prev = (pos - c->interpolate_baked(offset - delta_offset, cubic)).normalized();
Vector3 t_cur = (c->interpolate_baked(offset + delta_offset, cubic) - pos).normalized();