Im following a tutorial for creating a FPS and in that tutorial it shows how to make a gun shoot and play a sound by clicking left mouse button, when i click left mouse button it shoots but doesnt play the sound Code:
function Update () {
if(Input.GetButtonDown("Fire1")){
Fire();
}
}
function Fire(){
var bullet1 : Rigidbody = Instantiate(Bullet,Spawn.position,Spawn.rotation); bullet1.AddForce(bullet1.transform.forward*BulletSpeed);
GetComponent.<AudioSource>().play();
}
and the sound is in the same object as this script