How can I rotate my object towards another object with DORotate (DOTween)

Hi all,
How can I rotate my object towards another object with DORotate (DOTween)

There’s a DOLookAt method.

yeah but interestingly it didn’t work in my case

I solved in a very primitive but effective way.

  GameObject Rotater = new GameObject();
                        Rotater.transform.position = transform.position;
                        Rotater.transform.LookAt(ClosestRed.transform.position);
                        transform.DORotateQuaternion(Rotater.transform.rotation, 0.5f);

That’s pretty wasteful,. You could just do this without creating a whole GameObject:

Quaternion targetRotation = Quaternion.LookRotation(ClosestRed.transform.position - transform.position);
transform.DORotateQuaternion(targetRotation, 0.5f);
1 Like