y doesnt this shooting script work

this script creates the bullet but the force doesnt work:
var BulletPrefab:Transform;
var force : float = 2000;

function Update()
{
if(Input.GetButtonDown(“Fire1”))
{
var bullet = Instantiate(BulletPrefab

GameObject.Find(“Camera”).transform.position,

GameObject.Find(“Camera”).transform.rotation);

}
}

You don’t apply any force to the object with the code you’ve provided. Are you sure it’s an actual bullet you want to shoot through the scene (chances are if it’s a rigidbody it will go straight through any colliders).

You also don’t have to find an object two times, it’s better practice to do this:

var cam : Camera;
function Update () {
    ..cam.transform.position..
}

or variable the GameObject once it’s found (var go : GameObject = GameObject.Find(“name”))

Perhaps you should take a look at Physics.Raycast instead and see if you can apply it to your project instead.

As a footnote here’s how you add force to an object with a rigidbody.