Using Input.GetAxis variable for Touch Controls

Hey everybody, I’m having some trouble getting my touch controls to work right, and was wondering if anybody here has had experience with it.

I have my jump button linked to a guiTexture (as with my other controls), so it (in particular) was very easy to script for touch controls with a hitTest, but my left and right movement is a lot trickier.

The game in question is a 2D platformer. Currently the player moves by using this code:

var move : float = Input.GetAxis ("Horizontal");

if(move > 0){
     rigidbody2D.velocity.x = move * maxSpeed;
}
if(move < 0){
     rigidbody2D.velocity.x = move * maxSpeed;
}

How would I translate something like that to touch controls? It is essential that I use the input manager, because the gravity, speed, and other parameters have been fine tuned to make my character control exactly how I want. I wouldn’t know where to go to start hardcoding in all those values. I’m relatively novice.

C# version of swipe control. Im not good at JavaScript though it will only require some declaration tweaks to make it Java

// Update is called once per frame
	void Update () 
	{
		if(Input.GetTouch(0).phase == TouchPhase.Moved)
		{
			Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
			Debug.Log(touchDeltaPosition);
			touchDeltaPosition = new Vector2(touchDeltaPosition.x,
			                                 0);
			rigidbody2D.velocity = touchDeltaPosition;
		}
	
	}