Making Bullet Velocity

I need to make Bullet Velocity when I press the mouse 0 button but the bullet keeps dropping instead of going forward. This is my code

var bulletPrefab : Transform;
var Spawn : Transform;
var bulletSpeed : int;

function Update() {

	if (Input.GetKeyDown("mouse 0")){
		Debug.Log("Left mouse has been pressed");
		Fire();		
	}
}

function Fire (){
	var BulletPrefab = Instantiate(bulletPrefab, Spawn.position, Spawn.rotation);
	
	bulletPrefab.rigidbody.AddForce(transform.forward * bulletSpeed);
}

error code -

InvalidCastException: Cannot cast from source type to destination type.
gunShoot.Fire () (at Assets/Custom Scripts/gunShoot.js:14)
gunShoot.Update () (at Assets/Custom Scripts/gunShoot.js:9)

Btw you do know your applying force to your prefab variable and not your new GameObject? 0-o

var bulletPrefab : Transform;

var Spawn : Transform;

var bulletSpeed : float;

 

function Update() {

 

    if (Input.GetKeyDown("mouse 0")){

        Debug.Log("Left mouse has been pressed");

        Fire();     

    }

}

 

function Fire (){

    var BulletPrefab = Instantiate(bulletPrefab, Spawn.position, Spawn.rotation);
  

    BulletPrefab.rigidbody.AddForce(BulletPrefab.forward * bulletSpeed, ForceMode.Impulse);

}