/So I am new to unity and I'm building a game. I want it to be a top down shooter similar to hotline Miami. I am trying to get the sprite to rotate to face to mouse. How would I accomplish this in JavaScript?/
pragma strict
public var moveSpeed : float = 12f;
public var turnSpeed : float = 50f;
function Start () {
}
function Update () {
var mousePosition = Vector2;
if(Input.GetKey(KeyCode.D))
transform.Translate(Vector3.right * moveSpeed * Time.deltaTime );
if(Input.GetKey(KeyCode.S))
transform.Translate(Vector3.down * moveSpeed * Time.deltaTime );
if(Input.GetKey(KeyCode.A))
transform.Translate(Vector3.left * moveSpeed * Time.deltaTime );
if(Input.GetKey(KeyCode.W))
transform.Translate(Vector3.up * moveSpeed * Time.deltaTime );
transform.LookAt(mousePosition);
}