foreach (Touch input in Input.touches)
{
if (input.phase == TouchPhase.Moved)
{
Vector3 screenPoint = new Vector3 (Input.mousePosition.x, 65);
screenPoint.z = 11; //distance of the plane from the camera
transform.position = Camera.main.ScreenToWorldPoint(screenPoint);
}
}
The object follows the touch, but how do I get it moving with a velocity from position A to position B?
↧