Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.33k stars 350 forks source link

The SetLookAt function does not correctly calculate the look rotation angle when inside a non-uniformly scaled parent #502

Open fanstudiouk opened 3 years ago

fanstudiouk commented 3 years ago

Description

We are using DOLocalPath to tween an object that is set as a child to a non-uniformly scaled parent. We want to use a CubicBezier path with a TopDown2D path mode. Also, we want to orient the object to always be tangent along the bezier curve. We use SetLookAt for this.

We encountered the following issues (as can be seen in the attached image and also testes in the attached project):

Issues

  1. The bezier curve gizmo is drawn in world space instead of local space
  2. The rotation angle calculated by SetLookAt is wrong and the object is not tangent to the curve

Steps to reproduce

  1. Open the attached project
  2. Enter Play mode
  3. Select StartBothMovers object in hierarchy, open the StartBezierMovers context menu and select Start All Movers
  4. Observe the tween

Project - Unity 2020.3.13f1

DoTween Bug Project.zip

Steps to reproduce

Start Movers

Bugs description

Bugs