- Home /
Why LookRotation works, but LookAt doesnt
I had a Game Object with a Sprite Renderer component. I used to have the :
transform.LookAt(main.transform.position);
function to look at the camera, which worked fine. But since I added an animator to the Game Object, it doesn't let me modify the position and all of that. So I added that sprite component to a child of the main game object. And in that father Game Object, I now have to use:
transform.rotation = Quaternion.LookRotation(main.transform.position);
cause, if I use LookAt, it doesn't work. Does somebody now why??
Comment