problem drag object

prejudice in my scene I have 2 items that I want to move with the touch. I made this script and assigned to objects but when I click on an object, the second object follows exactly the object to be dragged.

#pragma strict

private var ray : Ray;
private var hit: RaycastHit;

function Start () {

}

function Update () {


  if(Input.GetMouseButton(0) || Input.touches ==move){
  
    ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    if(Physics.Raycast(ray,hit)){
    
    transform.position.x = hit.point.x;
    transform.position.y = hit.point.y;
    
    
    
    }
  
  
  print(ray);
  
  
  }

}

You are calling your touch incorrectly.

function Update () {
	for (var touch : Touch in Input.touches) {
		if (touch.phase == TouchPhase.Began) {
			// Construct a ray from the current touch coordinates
			var ray = Camera.main.ScreenPointToRay (touch.position);
			if (Physics.Raycast (ray, hit)) {
				// Do stuff.
			}
		}
	}
}

You need to define the touch class and then ask its touchPhase, touchPhase.move. Also, in your code you make no reference to a “second object”.