Hi, I Want to move object, on finger move not on touch only, here in that code When I touch my finger on screen then object get the position of, finger and get move immediately.
Sorry for poor English
Thanks.
void FixedUpdate ()
{
if (Input.touchCount > 0)
{
// The screen has been touched so store the touch
Touch touch = Input.GetTouch(0);
if (touch.phase == TouchPhase.Moved && touch.phase != TouchPhase.Stationary)
{
// If the finger is on the screen, move the object smoothly to the touch position
Vector3 touchPosition = Camera.main.ScreenToWorldPoint(new Vector3(touch.position.x, touch.position.y, 0.0f));
transform.position = Vector3.Lerp(transform.position, new Vector3(touchPosition.x, touchPosition.y+.5f, -.02f), Time.deltaTime * 5000f);
}
}
}