Random pitch footstep sound

I have a singular footstep sound. I want it to sound random every time, so it doesn’t get old when you walk a bunch. The game is very high paced, so I want it to play over and over, and if it’s already playing, play it again, but don’t stop the current sound.

This is my current code, which checks the velocity of the character controller and checks if you aren’t jumping:

// Controller = The character controller
// isGrounded = A bool, true if you are touching the ground, false if not
// groundSound = An AudioSource

if (isGrounded && controller.velocity.x != 0)
{
      groundSound.pitch = Random.Range(0.85f, 1.15f);
      groundSound.Play();
}

It works, but only when you stop walking, because it keeps playing over and over again, stopping the previous sound. I want to have a small delay between each play, and if possible, play it over the previous sound.

Any idea on how I could do this? I am a bit new to unity.

Cooldown timers, gun bullet intervals, shot spacing, rate of fire:

https://discussions.unity.com/t/821482/2

GunHeat (gunheat) spawning shooting rate of fire:

https://discussions.unity.com/t/824570/2

One simple way to trigger footstep sounds is to create an animation event on your walk animations.
Scroll through your animation and add that event wherever your character’s foot touches the ground.
Put the code to play the sound in a separate method. If the method has the same name as the animation event and the MonoBehaviour that contains that method is on the same object as the animator, then the method will trigger whenever the character steps.