- Home /
How to stop song when i dont hold W A S or D
Hi you guys, i have this script attached to my player for footstep song when i press w a s and d ...
var stepSound : AudioClip;
function Update () {
if (Input.GetKeyDown("w")||Input.GetKeyDown("a")||Input.GetKeyDown("s")||Input.GetKeyDown("d")){
audio.PlayOneShot(stepSound);
}
}
can u please tell me how i can stop the song when im not pressing the keys w a s or d ?
thanks a lot !
Comment
Your answer
Follow this Question
Related Questions
Adding force to a bullet 3 Answers
Animation flashlight when run 4 Answers
character joint scripting HELP!!! 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Destroy GameObject and play sound 1 Answer