Detecting Touch on moving Object - Help Needed!

Hi there,

Am creating a 2D-Game in which the player moves up and down the ship, when the user touch and drags in up and down direction. In the right side [30%] of the screen is used to drag the object up and down.

The Left Side [70%] is used to aim and shoot like slingshot. Problem is, I want the user to drag anywhere in the 70% left screen to pull the slingshot and shoot fruits.

Currently in my code, Am not sure how to append this idea, I want the user when he touch anywhere in the 70% screen and drag it should begin the dragging of slingshot right from the player point. Not from the finger touch point.

Also, in my code am not sure what am doing wrong, it is not projecting the fruits. Meaning fruits is not fired. Please help me to resolve the code and also explain it, so I can understand better. Thanks for your time. I have attached the image for better understanding`using UnityEngine;
using System.Collections;
using System;

public class slingShot_Mechanism : MonoBehaviour
{

private Vector3 slinngshotMiddleVector;

public Transform leftSlingshotOrigin;
public Transform RightSlingshotOrigin;

public GameObject FruitPrefab;

public float throwSpeed;
public float timeSinceThrown;
public Transform fruitWaitPosition;

void Start()
{
	slinngshotMiddleVector = new Vector3((leftSlingshotOrigin.position.x+ RightSlingshotOrigin.position.x)/2,(leftSlingshotOrigin.position.y+RightSlingshotOrigin.position.y)/2,0);
	initializeFruit();
}

void Update()
{

		initializeFruit();

					if(Input.GetMouseButtonDown(0))
					{
					Vector3 location = Camera.main.ScreenToWorldPoint(Input.mousePosition);

					if(FruitPrefab.GetComponent<CircleCollider2D>()== Physics2D.OverlapPoint(location))
					  {
					    Debug.Log("User is Pulling the slinghsot");
	                  }
	                }

  
					if(Input.GetMouseButton(0))		
					{
					   Vector3 location = Camera.main.ScreenToWorldPoint(Input.mousePosition);
					   location.z = 0;

					       if (Vector3.Distance(location,slinngshotMiddleVector)> 0.3f)
					       {
					         var maxPos = (location - slinngshotMiddleVector).normalized * 0.3f + slinngshotMiddleVector;
					         FruitPrefab.transform.position = maxPos;			                  
					       }

					else
					{
					      FruitPrefab.transform.position = location;
					}

		            float distance = Vector3.Distance(slinngshotMiddleVector,FruitPrefab.transform.position);
					}

	else // User Removed the Finger
	{
		timeSinceThrown = Time.time;
		float distance = Vector3.Distance(slinngshotMiddleVector,FruitPrefab.transform.position);
		
				if (distance > 0.2f)
				{						
				    ThrowFruit(distance);	
				}

				else //not pulled long enough, so reinitiate it		
				{

				}	 

	  }

}

private void ThrowFruit(float distance)
{
	Vector3 velocity = slinngshotMiddleVector - FruitPrefab.transform.position; 
	FruitPrefab.GetComponent<Rigidbody2D>().velocity = new Vector2(velocity.x, velocity.y) * throwSpeed * distance;

}

private void initializeFruit()
{
	FruitPrefab.transform.position = fruitWaitPosition.position;
}

} 35844-logic_01.png`

The slingshot mechanism same as ZomBirds Game style.
Ref: Shoot The Zombirds Gameplay 2 All Characters and Everything Maxed - YouTube

public Action OnTap = (Vector3 v) = >{};
void Update(){
if(Input.touchCount > 0)
{
foreach(Touch t in Input.touches)
{
OnTap(t.position);
}
}
}

then somewhere else you have a class that listens to this:

float thirdScreen;
void Start(){
   // This means your InputSystem has a singleton pattern
   // Else just do a GetComponent or drag and drop
   InputSystem.Instance.OnTap += this.CheckInput;  

   thirdScreen = Screen.width / 3f * 2f;
   // or thirdScreen = Screen.width * 0.7f;
}

private void CheckInput(Vector3 position)
{
   if(position.x > thirdScreen)
   {
       Move();
   }
   else
   {
       Shoot();
   }
}

I would actually put move and shoot to their own classes but at least you get the idea.