Mouse Input -> Mobile Touch Input

I am trying to compile my research application to Android OS. This is requiring some of the camera mouse movements to be ported to a touch interface.

Orignal Code:

	if (Input.GetButtonDown("Fire2") ) {
		slideStart = mainCamera.ScreenPointToRay(Input.mousePosition).GetPoint(1.0);
	}
	if (Input.GetButton("Fire2") ) {
		slideTarget = mainCamera.ScreenPointToRay(Input.mousePosition).GetPoint(1.0);
	}
/* What I think this does (I didnt write it, a group member)
 is that on mouse down sets the start point as a vector from ray mouse position. 
And for as long as it's held down, it updates the target to a vector of the ray mouse positon. */

My Conversion:

	if(Input.touchCount > 0 ){

		if (Input.GetTouch(0).phase == TouchPhase.Began) {
			slideStart  = mainCamera.ScreenPointToRay(Input.GetTouch(0).position).GetPoint(1.0);
		}
		if (Input.GetTouch(0).phase == TouchPhase.Moved) {	
			slideTarget = mainCamera.ScreenPointToRay(Input.GetTouch(0).position).GetPoint(1.0);
		}

	}

/*Similar methods as the above code.
 Began is called on the start of the touch, and Moved (i think) updates every frame while the user drags.
 Both return vectors of the ray casted postion.*/

Relevenat Code:

	//---- Find translation
var trans = smoothing*(slideStart - slideTarget)/2;
	trans.y = 0;
	
//---- Update end points
	FarPos = Vector3.Lerp(FarPos, FarPos + trans, smoothing*Time.deltaTime);
	FarPos.x = Mathf.Clamp(FarPos.x, -scrollBounds.x/2, scrollBounds.x/2);
	FarPos.z = Mathf.Clamp(FarPos.z, -scrollBounds.z/2, scrollBounds.z/2);
	NearPos = Vector3.Lerp(NearPos, NearPos + trans, smoothing*Time.deltaTime);
	NearPos.x = Mathf.Clamp(NearPos.x, -scrollBounds.x/2, scrollBounds.x/2);
	NearPos.z = Mathf.Clamp(NearPos.z, -scrollBounds.z/2, scrollBounds.z/2);
	slideStart = Vector3.Lerp(slideStart, slideTarget, smoothing*Time.deltaTime);
	
    //----Final Interpolation
    transform.position = Vector3.Lerp(NearPos, FarPos, zoom);

The Camera ends up just bugging out and flying to the edge of the screen. I’ve tried so many options: Having only .Begin and then updating the target every frame, using deltaPostion for the target variable … I’m just hitting a wall here.

With the lengthy time to compile an apk, move it to my development device, install, see the bug, uninstall, then repeat — I thought I’d poke the minds of a community who’s already worked with touch points. I’m not extremely tied to the functionality as it currents works. Any ideas? Thanks for your time.

[SOLVED] The Bug: Input.Touch returns a Vec2 and Input.mousePosition is a Vec3. My logic was correct, so by instantiating a Vec3 from the Input.GetTouch() fixed the problem!