I have made a mech type robot for my scene. the top half is what i called the turret.
the turret spind and has an audio source that works fine. inside the turret i have two arms that are combined into one object that also move up and down these also have an audio file attached that works fine. inside the arms i have a prefab to make it shoot, this also works fine. What i want to do is add an audio file to make a firing sound for the guns. I want ot make the sound play when i press the shoot command. Can anybody help me out on how to do this.
i will post the firing script
var projectile : Rigidbody;
var speed = 20;
function Update () {
if ( Input.GetButton (“Fire1”)) {
clone = Instantiate(projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection( Vector3 (0, 0, speed));
Destroy (clone.gameObject, 2);
}}
thanks
wayne