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);
}
}