Browse Source

Merge pull request #44279 from KoBeWi/unit_offset_or_something_idk

Fix PathFollow3D updating on unit_offset 0
Rémi Verschelde 4 years ago
parent
commit
dc589a64e6
1 changed files with 1 additions and 5 deletions
  1. 1 5
      scene/3d/path_3d.cpp

+ 1 - 5
scene/3d/path_3d.cpp

@@ -94,10 +94,6 @@ void PathFollow3D::_update_transform(bool p_update_xyz_rot) {
 		return;
 		return;
 	}
 	}
 
 
-	if (delta_offset == 0) {
-		return;
-	}
-
 	float bl = c->get_baked_length();
 	float bl = c->get_baked_length();
 	if (bl == 0.0) {
 	if (bl == 0.0) {
 		return;
 		return;
@@ -156,7 +152,7 @@ void PathFollow3D::_update_transform(bool p_update_xyz_rot) {
 
 
 		t.origin = pos;
 		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_prev = (pos - c->interpolate_baked(offset - delta_offset, cubic)).normalized();
 			Vector3 t_cur = (c->interpolate_baked(offset + delta_offset, cubic) - pos).normalized();
 			Vector3 t_cur = (c->interpolate_baked(offset + delta_offset, cubic) - pos).normalized();