Can someone help me with this script:
var projectil : Rigidbody;
var timer : float = 1;
var speed : float = 1;
function Update ()
{
timer -= Time.deltaTime;
}
if(Input.touchCount > 0)
{
var touch: Touch = Input.touches[0];
if(touch.phase == TouchPhase.Began guiTexture.HitTest(touch.position))
{
if ( timer <= 0 )
{
timer -= timer += speed;
Instantiate(projectil ,transform.position ,transform.rotation);
}
}
}