- Home /
Footsteps Sound Effect causing other Audio Clipping or no sound at all.
Hi,
Basically I've got Random Sound Triggers in my game that when the player walks on them, the game will play sounds as referenced via a script - it all worked fine. But then I added Footsteps sound effects into the game, now the Footsteps dominate the audio in the game with their sound file often cutting off the Random Sound Triggers audio or with the player entering the Random Sound Trigger and no sound from it being played.
Does anyone have any suggestions? I think it may have something to do with the priority of the sounds however I don't know what I'm doing with that. Does anyone know of a tutorial that deals with multiple sound files in a game or can offer general advise?
Thanks in advance.
I was before but since this post I've added multiple ones and have changed the priorities of the sounds but I still am getting some cut-offs.
I think it might be something to do with the Footstep script as the Random Sound Triggers work when the Player is Sprinting but not while the Footsteps are playing and the Footsteps sound effect has the lowest priority in my scene.
Answer by CyaBB · Sep 29, 2017 at 12:45 PM
After some research i read that you need the same amount of audio sources as amount of clips you want to play. So i added 4 audiosources to my script and played every single clip on a different audio source.
private AudioSource[] source;
source = GetComponents<AudioSource>();
source[1].PlayOneShot(gunshot, vol);
source[2].PlayOneShot(swordSlash, vol);
source[3].PlayOneShot(bloodyHit, vol);
Like this. It fixed it and worked very well. The FPSController is default using the first audio source which is attached on default to the FPSController.