Skip to main content
Tweeted twitter.com/StackGameDev/status/1572737526535974913
edited tags
Link
DMGregory
  • 141k
  • 23
  • 258
  • 401
Source Link

Unity Quaternion.LookRotation meaning

I've gone through Unity's documentation for Quaternion.LookRotation, but I didn't get the full understanding of how it works.

  1. What is the meaning of Creates a rotation with the specified forward and upwards directions?
  2. And if I have to rotate my object in X axis I have to modify both X and Z axisVector3 lookAt = new Vector3(relativePos.x, 0, relativePos.z); transform.rotation = Quaternion.LookRotation(lookAt);, why can't I only just modify the X axis directly to rotate?