Rotate to mouse cursor error


i have a working rotate to cursor script for my 2d game but it is 90 degrees off e.g. when the cursor is at the top of the screen the ship is pointing left.


function Update () {

    var mousePos = Input.mousePosition;
    var lookPos : Vector3 = Camera.main.ScreenToWorldPoint(mousePos);
    lookPos = lookPos - transform.position;
    var angle : float = Mathf.Atan2(lookPos.y, lookPos.x) * Mathf.Rad2Deg;
    transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);



The easiest solution is to just rotate your texture, but you can modify the angle:

transform.rotation = Quaternion.AngleAxis(angle-90.0, Vector3.forward);