Q:

Setting Unity script to an object

I've got a simple question: Why my swipe script swipes on the whole screen while it's supposed to work only on the set prefab? And why my move script which moves the object on swipe on it, moves also all the clone objects? I need some ideas. Thanks.
SwipeHandler:
using UnityEngine;
using System.Collections;

public class SwipeHandler : MonoBehaviour
{
public static SwipeHandler instance;
public float minMovement = 20.0f;
public bool sendUpMessage = true;
public bool sendDownMessage = true;
public bool sendLeftMessage = true;
public bool sendRightMessage = true;
public GameObject MessageTarget = null;
private Vector2 StartPos;
private int SwipeID = -1;

void Awake(){
    instance = this;
}

void Start()
{

}

void Update ()
{
    if (MessageTarget == null)
        MessageTarget = gameObject;
    foreach (var T in Input.touches)
    {
        var P = T.position;

        if (T.phase == TouchPhase.Began && SwipeID == -1)
        {
            SwipeID = T.fingerId;
            StartPos = P;
        }
        else if (T.fingerId == SwipeID)
        {
            var delta = P - StartPos;
            if (T.phase == TouchPhase.Moved && delta.magnitude > minMovement)
            {
                SwipeID = -1;
                if (Mathf.Abs(delta.x) > Mathf.Abs(delta.y))
                {
                    if (sendRightMessage && delta.x > 0)
                        MessageTarget.SendMessage("OnSwipeRight", SendMessageOptions.DontRequireReceiver);
                    else if (sendLeftMessage && delta.x < 0)
                        MessageTarget.SendMessage("OnSwipeLeft", SendMessageOptions.DontRequireReceiver);
                }
                else
                {
                    if (sendUpMessage && delta.y > 0)
                        MessageTarget.SendMessage("OnSwipeUp", SendMessageOptions.DontRequireReceiver);
                    else if (sendDownMessage && delta.y < 0)
                        MessageTarget.SendMessage("OnSwipeDown", SendMessageOptions.DontRequireReceiver);
                }
            }
            else if (T.phase == TouchPhase.Canceled || T.phase == TouchPhase.Ended)
            {
                SwipeID = -1;
                MessageTarget.SendMessage("OnTap", SendMessageOptions.DontRequireReceiver);
            }
        }
    }
}    

}
Move:
using UnityEngine;
using System.Collections;

public class Move : MonoBehaviour {
public static Move instance;
public GameObject obj;

public float speed = 80f;
protected bool swLeft;
protected bool swRight;
// Use this for initialization

void Awake(){
    instance = this;
}

void Start(){

}

// Update is called once per frame
void Update () {
    if (obj == null)
        obj = gameObject;

    //transform.Translate(Vector3.down * Time.deltaTime, Space.World);
    //transform.Translate(0, -Time.deltaTime * speed, 0, Space.World); // Camera.main.transform bu da oluyor.

    if(swLeft == true){
        obj.transform.Translate(-Time.deltaTime * speed * 35, 0, 0, Space.World);
    }else if(swRight == true){
        obj.transform.Translate(Time.deltaTime * speed * 35, 0, 0, Space.World);
    }else{
        obj.transform.Translate(0, -Time.deltaTime * speed, 0, Space.World);
    }
    //obj.transform.Translate(0, -Time.deltaTime * speed, 0, Space.World);
    //gameObject.transform.Translate(0, -Time.deltaTime * speed, 0, Space.World);
}
void OnSwipeLeft()
{
    //transform.position -= Vector3.right*200;
    //gameObject.transform.Translate(-Vector3.right * speed * Time.deltaTime);
    swLeft = true;
    swRight = false;
}
void OnSwipeRight()
{
    //gameObject.transform.Translate(Time.deltaTime * speed, 0, 0, Space.World);

    //gameObject.transform.Translate(Vector3.right * speed * Time.deltaTime);

    swRight = true;
    swLeft = false;
    //transform.position += Vector3.right*200;
}

}
As I said, I set the scripts to a prefab aiming to move object right or left depending on the swipe ON the object. But swipe works anywhere on the screen, not only on the object.

A:

The reason your swipe script works on the whole screen is because you are just checking for touches, and not checking to see if your touch is hitting the object, In order to do that you need to do a Ray cast, and each of your objects needs to have a collider on them
if (T.phase == TouchPhase.Began && SwipeID == -1)
{
    Ray ray = Camera.main.ScreenPointToRay(P);
    RaycastHit hit;
    if (Physics.Raycast(ray, out hit, 100))
    {

         if(hit.collider.gameObject == "one of your clone objects")
         {
              SwipeID = T.fingerId;
              StartPos = P;
              MessageTarget = hit.collider.gameObject;
         }
    }
}

If you have the SwipeHandler script on all of your object that gets duplicated this would them all check the touch input and send the move message since your script didnt check for collision to a certain game object.  From the looks of it, your SwipeHandler script should only be one GameObject and the ray cast will tell you which game object should be your "MessageTarget"

