#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.