What can i add to this script so it can jump and have gravity?
//Drag the Spawned Object Enemy across 3D plane======
//var enemyselect : Transform; (NB: I used to have this in there until i realised it had no effect. In the inspector on the prefab object i would choose the prefab itself - but i need a way for the touch to register ONLY on each spawned object individually.)
var hit : RaycastHit;
function Update () {
var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
for (touch in iPhoneInput.touches) {
if (Physics.Raycast (ray, hit, 100) (hit.transform == transform)) {
if (iPhoneInput.touchCount > 0 iPhoneInput.GetTouch(0).phase == iPhoneTouchPhase.Moved) {
transform.position = Camera.main.ScreenToWorldPoint(new Vector3 (touch.position.x,touch.position.y,10));
}
}
}
}
[/quote]