- Home /
Duplicate Question : http://answers.unity3d.com/questions/582027/help-with-simple-footsteps.html
Simple footsteps?
Hello,
I am trying to get simple footsteps in my scene. All I have in the scene is a First Person Contoller with an audio source (has the footstep sound attached to it) and a floor. I need the audio to play when the W A S and D keys are pressed. If multiple keycodes are told to play the audio, the sound restarts when you strafe (hold down more than 1 key.) Is there any way to achieve this without the sound restarting? Thanks you SO much for your help!!
Answer by Sundar · Dec 01, 2013 at 06:58 PM
Play audio only when it's not playing, like
If( !audio.isPlaying ) audio.Play();
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Footsteps? 4 Answers
Can anyone help me modify this simple script? 5 Answers
sound on key down help 2 Answers