Bullet shots direction player is facing, cant shoot in diagnal or up

hi, here is my bullet script

var Bullet : Transform; var ROF = 10.0; // Rate of fire in bullets/sec. private var timeout = 0.0;

function Update () { if (Input.GetButton ("Fire1") && Time.time >= timeout){ var bullet = Instantiate(Bullet,GameObject.Find("BulletSpawn").transform.position,Quaternion.identity); bullet.rigidbody.AddForce(transform.forward *1000); Destroy(bullet.gameObject, 2); timeout = Time.time + 1.0/ROF; } }

when I shoot, it will shoot the direction that im facing. so i can do a compleat circle and shoot fine. but when I shoot at an upward angle, the bullets go parallel to the ground. what should i do. i also get a error message saying

UnassignedReferenceExceprion: The variable Bullet of 'Shooting script' has not been assigned. but in the inspector, it is assigned. thanks for your time

I assume "BulletSpawn" is at the end of your gun. If "BulletSpawn" is attached to character that is animated then I would expect this to work.

If however "BulletSpawn" is just a fixed position against the the player controller then it will fire at the same plane as the player controller.

I guess a quick experiment would be to replace "BulletSpawn" to whatever the camera is called. In theory then you should fire in the same direction that you are viewing.

Not an expert so appologies if this answer is incorrect but something to try.

is the spawn attached to your camera so that if you look up the spawn will be there too.