I got the error: "Assets/Scripts/_pistolAI.js(7,47): BCE0019: 'GetTouch' is not a member of 'UnityEngine.Input'. Did you mean 'GetKey' ?"
http://unity3d.com/support/documentation/ScriptReference/Input.GetTouch.html
// Shoot a ray whenever the user taps on the screen
var particle : GameObject;
function Update () {
for (var i = 0; i < Input.touchCount; ++i) {
if (Input.GetTouch(i).phase == TouchPhase.Began) {
// Construct a ray from the current touch coordinates
var ray = Camera.main.ScreenPointToRay (Input.GetTouch(i).position);
if (Physics.Raycast (ray)) {
// Create a particle if hit
Instantiate (particle, transform.position, transform.rotation);
}
}
}
}