# Sound Management Help

I just learned how to implement a Sound Manager and put sounds into it. The problem is, I'm making a platformer and I have a player, and two different types of enemies who all have footstep sounds. The main issue is that I'm playing all the sounds from the same sound manager and I made the footstep sounds of the player to play like this:

  public void PlayMoveSound()
{
if(audioSrc.isPlaying == false)
{
randomMoveSound = Random.Range(0,5);
audioSrc.PlayOneShot(moveSounds[randomMoveSound]);
}
}


I don't know how else to make it NOT sound like its playing 100 times per second so I did this. This gave birth to the issue that the looping audio which is the player's movement sound now blocks me from doing the same thing for the other characters' footstep sounds since it uses the same "audioSrc" AudioSource. Any hints on how different I can create a system for semi-looping audio?

• I personally prefer to make footstep sounds part of the walk animation. This way the sound repeat speed is always automatically tied to the speed of the walking animation and they are always in perfect sync. You can search google for "unity animation events", they are basically method calls at specific point during an animation. – Nikaas Oct 4 '20 at 10:56
• @Nikaas thanks mate, I'll look into that. Didn't know such a thing existed. – Scott Weiland Oct 4 '20 at 11:04
• Footsteps are an odd choice to run through a centralized manager. Usually we'd play them through an audio source on each character's model/sprite, so they get correct spatialization (eg. panning the sound left when the character is on the left side of the screen) – DMGregory Oct 4 '20 at 12:45