Fix Path3D initial forward calculation

(cherry picked from commit 102ec1042b)
This commit is contained in:
Raul Santos 2021-08-07 12:40:14 +02:00 committed by Rémi Verschelde
parent 32bbe644ca
commit f38abd593d
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ void PathFollow::_update_transform(bool p_update_xyz_rot) {
// will be replaced by "Vector3(h_offset, v_offset, 0)" where it was formerly used // will be replaced by "Vector3(h_offset, v_offset, 0)" where it was formerly used
if (rotation_mode == ROTATION_ORIENTED) { if (rotation_mode == ROTATION_ORIENTED) {
Vector3 forward = c->interpolate_baked(o_next, cubic); Vector3 forward = c->interpolate_baked(o_next, cubic) - pos;
// Try with the previous position // Try with the previous position
if (forward.length_squared() < CMP_EPSILON2) { if (forward.length_squared() < CMP_EPSILON2) {