Hi, I need to move my airplane in direction of current mouse position.
In 2D space.
Thanks!!!
Hi, I need to move my airplane in direction of current mouse position.
In 2D space.
Thanks!!!
var depth = 10.0;
function Start ()
{
Screen.showCursor = true;
}
function Update ()
{
var mousePos = Input.mousePosition;
var wantedPos = Camera.main.ScreenToWorldPoint (Vector3 (mousePos.x, mousePos.y, depth));
transform.position = wantedPosition;
}