transform.LookAt vs Quaternion.LookRotation

Hello…

Im pretty new to Unity, like 3 days or so.
I’m also pretty new to scripting and coding, atleast C#.

My question is, what is the major difference between these two functions?

transform.LookAt(Vector3)
Quaternion.LookRotation(Vector3)

I scripted an object to move towards my mouse pos, and rotate to face the direction, but I found that transform.LookAt() was working badly and took several seconds to actually rotate the object correctly.
Quaternion.LookRotation() however, was smooth and instant.

I just hate to use a script/function I dont understand, so what is quaternion exactly ?

Thanks in advance.

That would actually be a problem with the code you’re using, since LookAt returns a value immediately and has no issues. LookAt is basically a convenience function, since it’s simpler to use than LookRotation for the kind of behavior you usually want. But you can construct arbitrary rotations with LookRotation for those cases where you might need to do that.

–Eric