[Solved] Rotating with lookat on 2D

I’m trying to rotate an object on 2D unity on android, just pretend to look at the position of the touch, but when i do the lookat, the object gets crazy and rotate on angle x and y but no z. My code is simple:

    Vector3 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    pos.z = 0;

What am i doing wrong?

I never got LookAt to work, either. Arctangent does the job, though. Here’s a snippet from my code (CurFlip is just 1 or -1 based on whether the sprite’s X scale is 1 or -1 at the time):

transform.rotation = Quaternion.Euler (0.0F, 0.0F, Mathf.Atan2 ((CurY - transform.position.y) * CurFlip, (CurX - transform.position.x) * CurFlip) * Mathf.Rad2Deg);