Merge pull request #51357 from raulsntos/fix-51342

Fix Path3D initial forward calculation
This commit is contained in:
Rémi Verschelde 2021-08-07 13:30:19 +02:00 committed by GitHub
commit d6329c5f08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -120,7 +120,7 @@ void PathFollow3D::_update_transform(bool p_update_xyz_rot) {
// will be replaced by "Vector3(h_offset, v_offset, 0)" where it was formerly used
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
if (forward.length_squared() < CMP_EPSILON2) {