Problems implementing sound for machine gun enemy:

I'm using the generic sentry gun as outlined in the FPS tutorial, and have had a frustrating problem implementing sound. The tutorial describes how to put the sound in for the machine gun weapon, but it doesn't describe such a method for the sentry, and none of the obvious approaches seem to work.

I've tried attaching sounds to every aspect of the sentry, the muzzle flash, the impact sparks, etc, but I can't get it to make any noise. I'm using the sentry for a "run for cover" sort of challenge, so sound is very important (the player needs to know when it's stopped firing).

This isn't just for fun, I need this for a "build a level in two weeks" test for a game design job. My future in the industry depends on getting this right, so any help would be appreciated!

Okay doky, lets see what we can do here.

In your script, I'm assuming you will have a line of code that says:

// If we are almost rotated towards target - fire one clip of ammo
    var forward = transform.TransformDirection(Vector3.forward);
    var targetDir = target.position - transform.position;
    if (Vector3.Angle(forward, targetDir) < shootAngleDistance)

Simply add an:--> After the if statement


What you want to do now is add an audio source to your turret, then drag your audio file into that source, and check play automatically OFF. Play the game and it should work, if not, Restart Unity. There is a bug in unity where the audio cuts out sometimes.

Hi there i am looking for ww1 it says u will tell me about it. obviously not!