You can't use *yield* inside Update or any other periodic routine (LateUpdate, FixedUpdate, OnGUI), but a very similar approach can work if started at Start (yes, Start can use *yield*!):
var footsteps : AudioClip; var waitTime = 0.5; function Start () { // create an infinite loop that runs every frame: while (true){ if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.1){ yield WaitForSeconds(waitTime); audio.Play(footsteps); } yield; // let Unity free till next frame } }This implements a kind of private Update: the code inside the *while* infinite loop is executed every frame, then the yield instruction lets Unity free to take care of its business until next frame.