Panning using DragDrop (FingerGestures) Mechanism

I have a large image that I’d like to allow the user to pan across by dragging their finger on the screen. I’ve been trying to make this happen using FingerGestures…but the sample solution to drag/drop doesn’t quite do it. As you can see in the attached code, it matches the transform.position of the picture to the finger touch; which means that instead of being able to pan across an image, it recenters itself over the finger with every new touch.

function FingerGestures_OnDragMove( fingerPos : Vector2, delta : Vector2 )

{

    if( draggedBody )

    {

        // convert the finger position to world position

        var distToCamera : float = Mathf.Abs( draggedBody.transform.position.z - Camera.main.transform.position.z );

        

        var fingerWorldPos : Vector3 = Camera.main.ScreenToWorldPoint( new Vector3( fingerPos.x, fingerPos.y, distToCamera ) );

    

        // center the object on our moving finger

        draggedBody.MovePosition( fingerWorldPos ); 

    }

}

Could I get some guidance on this from some of you more practiced in this sort of thing? Thanks!

I think if you just build a swipe from scratch, you must account for delta pos of finger. Delta being change of position over time. If delta constitutes a swipe, do this() function. Otherwise nothing. If you want to drag an image, on swipe, drag, then u must account for the above, and the position offset of the image, vs the touch pos as well.