How to add footsteps to Lerpz?

Hi,

I've been trying to build my own 3D platform demo using the Lerpz 3D platform tutorial as a basis. I've made a sample platform and my own character. Managed to also put sounds for jumping, landing but I can't figure out how to put the sounds for the footsteps.

I tried adding an audiosource to the player and used audio.Play() whenever the character moves and is grounded but it played the audio rapidly. Same thing goes when set the condition to function with the animation state(walk).

I tried using the footsteps script from the 2D tutorial and even though there were no errors, it still didn't work :(

What's the best(and optmised) way of creating footsteps?

Thanks very much.

-Hakimo

Hello,I am Nishanth Hegde.Even I had the same problem before but now it is historied!I have a very simple way of adding sounds. Enter this scrip into your FPScontroller.

var audioStepLength = 0.3; var walkSounds:AudioClip[];

function Start () { var controller : CharacterController = GetComponent(CharacterController);

while (true)
{
    if (controller.isGrounded && controller.velocity.magnitude > 0.3)
    {
        audio.clip = walkSounds[Random.Range(0, walkSounds.length)];
        audio.Play();
        yield WaitForSeconds(audioStepLength);
    }
    else
    {
        yield;
    }
}

}

add this to your FPS.Then add a audio listener to the Main Camera.Change the size to 1 in the script and add footstep sound to it.Then click Play and then u shd have ur sound :)