Hi,I’m creating a simple FPS game,everything went pretty good but the shooting is not working,when I shoot the bullet just floats in front of me,and there’s no sound at all(I’ve put the sound in correctly),can someone help?This is my Gun script.
var Bullet : Rigidbody;
var Spawn : Transform;
var BulletSpeed = 100000;
function Update () {
if(Input.GetButtonDown("Fire1")){
Fire();
}
}
function Fire () {
var bullet1 : Rigidbody = Instantiate(Bullet,Spawn.position,Spawn.rotation);
bullet1.AddForce(transform.foward *BulletSpeed);
audio.Play();
}