Quaternion.LookRotation precision error

Hey there!

I’m having a hard time trying to deal with the precision using Quaternion.LookRotation…

Why is this happening? The image it explains for itself. The white line is a Debug line from the rocket transform to the target transform.

Precision error

Also, there’s the piece of code relevant to the Quaternion.LookRotation

Quaternion lookAtTarget = Quaternion.LookRotation(target.position - transform.position);
rigidbody.rotation = Quaternion.Lerp(rigidbody.rotation, lookAtTarget, Time.deltaTime * turnSpeed);

Any hint?

You may not want to manipulate the rigidbody’s rotation directly as it’s supposed to be manipulated via rigidbody.AddTorque.
However, as mentioned in the API reference, if you wish to control the rigidbody’s rotation precisely from code you should use rigidbody.MoveRotation. In order to do that smoothly, I suggest you slerp a temporary quaternion in the Update method, then feed it’s value to the MoveRotation in the FixedUpdate method.