Change Input.GetTouch(0).deltaPosition to object transform position in Unity 4.3 for 2D

Hi,
I am new in Unity 3d, I want to move ball on same direction when user tap on ball and move his finger. I got few hints to get user’s finger position from “Input.GetTouch(0).deltaPosition;” and get object’s position “transform.position” but “transform.position” give me position according to scene view and “Input.GetTouch(0).deltaPosition;” give position according to device screen. How can I convert “Input.GetTouch(0).deltaPosition;” to “transform.position” scene view wise or vice versa, so that it’ll be easy for me to move ball, because I am getting confuse with different position. Kindly help me on this and suggest me better approach to accomplish this task. Thanks in advance.

deltaPosition doesn’t contain your finger position, but position change between frames.

Try passing the position of your finger touch into Camera.ScreenToWorldPoint(). To get the position of your “mouse” on screen you can using Input.mousePosition. To get a touch event you can add an entry to the Input Manager for the mouse, and use Input.GetButton() to determine whether the button is being held down.

e.g.

if(Input.GetButton("Mouse"))
{
Vector 3 fingerPosition = Input.mousePosition;
Vector3 worldPosition = Camera.ScreenToWorldPoint(fingerPosition); 
transform.position = worldPosition;
}

You should use something like Camera.ScreenToWorldPoint:

http://docs.unity3d.com/Documentation/ScriptReference/Camera.ScreenToWorldPoint.html