How come this error pops up?

#pragma strict
var projectile : Rigidbody;
var speed = 20;

function Update () {

if ( Input.GetButton ("Fire1")) {

clone = Instantiate(projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection( Vector3 (0, 0, speed));

Destroy (clone.gameObject, 3);

}}

After i put this in it gives me this error message
05: Unknown identifier: ‘clone’.
What do i use instead?

You don’t declare clone. At the very least you need ‘var clone’. This is how I might write this code:

#pragma strict
 
var projectile : GameObject;
var speed = 20.0;

function Update () {
	if ( Input.GetButton ("Fire1")) {
		var clone = Instantiate(projectile, transform.position, transform.rotation) as GameObject;
		clone.rigidbody.velocity = transform.TransformDirection( Vector3 (0, 0, speed));

		Destroy (clone, 3.0);
	}
}