Drag each object with touches

I´m writing a simple script in Unity version 3.5.

First of all, I can’t do the raycast sentence work properly, I prove this script in my Android and nothing happens

#pragma strict

var speed : float = 10;
var hit = new RaycastHit();
function Update () {

if (Input.touchCount > 0  Input.GetTouch(0).phase == TouchPhase.Began) {

var ray = Camera.main.ScreenPointToRay (Input.GetTouch(0).position);
if (Physics.Raycast (ray, hit)) {

Destroy(hit.transform.gameObject);
}
}

}

please if someone can help me, i´m very new in Android

Please don’t double post. I answered your question in the previous thread. You need to attach this script to your Cube GameObject not the Camera like you said you were.

Mike

sorry I post this before the other… and I post this with other intention that the other…

I don’t know how cancel the Thread