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