So I’m making a 3D top down Shooting game and it coming out ok but I just can’t get the aim to rotation right. Here my code, what am I’m doing wrong.
var mouse : Vector3;
var rot : Quaternion;
function Update ()
{
mouse = Camera.main.ScreenToWorldPoint(Input.mousePosition);
rot = Quaternion.LookRotation(target.position - mouse, Vector3.forward);
transform.LookAt(rot);
}
PLZ HELP