- Home /
Transform.LookAt - Look through Y-Axis?
Hello all,
I'm trying to use transform.Lookat to rotate a sprite to look toward my mouse position.
However rather than pointing to my mouse position via the Y axis, it points my sprite via it's Z axis instead.
This obviously causes the sprite lay flat and rotate. Meaning it cannot be seen correctly by the camera.
Anyone have a fix?
Thanks.
Answer by neonblitzer · Mar 01, 2015 at 09:31 PM
The Z axis is Unity's forward axis, so all LookAt calls orient the object that way.
Here's a similar question, check out Duck's answer. http://answers.unity3d.com/questions/29856/lookat-but-without-z-axis.html#answer-container-29885
Your answer
![](https://koobas.hobune.stream/wayback/20220613184652im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
use world axis when using transform.rotate 3 Answers
use world axis when using transform.rotate 0 Answers
camera move x axis 2 Answers
Object rotation 2 Answers
Transform.Rotate() problem : Avoid Z-axis rotation ? 0 Answers