UCE0001 Please insert a semi colon Javascript

#pragma strict

var prefabBullet:Transform;

function Start () {

}

function Update () {
	if(Input.GetButtonDown("shoot")){
		var prefabBullet - Instantiate(prefabBullet, transform.position, Quaternion.identity);
		prefabBullet.rigidbody.AddForce(transform.forward * 10);
	}
}

When I try to run this, it says I need a semi colon, although I do. What is wrong with this script? I have a prefab for the bullet set up, joint to the camera. I don’t see why it’s not working, please help.

there is mistake in your code :

try to use other variable and use below line :

var obj : GameObject = Instantiate(prefabBullet, transform.position, Quaternion.identity);
obj.rigidbody.AddForce(transform.forward * 10);