Projectile Script

Where am I going wrong? The projectile will not move forward.

var enemy : Transform;
var shot : Rigidbody;
var waitTime = 3;
var speed = 10;

function Start () {

 var dist : float = Vector3.Distance(enemy.position, transform.position);
 Debug.Log(dist);
 yield WaitForSeconds (waitTime);
 projectileSpeed = dist;
 Shoot();

}

function Shoot () {
print ("shoot!");
    var projectile : Rigidbody = Instantiate(shot, transform.position + Vector3(2,2,0), transform.rotation);
    projectile.velocity = transform.forward * speed;
}

Thanks!

The line to set the velocity should be:

projectile.velocity = transform.TransformDirection(Vector3.forward * speed);