Advertisement
kasru

Walking Audio

Jan 19th, 2013
5,251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //****** Donations are greatly appreciated.  ******
  2. //****** You can donate directly to Jesse through paypal at  https://www.paypal.me/JEtzler   ******
  3.  
  4. function Start () {
  5.     audio.volume = 0;
  6.  
  7. }
  8.  
  9. function Update () {
  10.  
  11. if(Input.GetKey("a") && Input.GetMouseButton(1) || Input.GetKey("w") && Input.GetMouseButton(1) || Input.GetKey("d") &&         Input.GetMouseButton(1)
  12. || Input.GetKey("s") && Input.GetMouseButton(1) || Input.GetKey("w") && Input.GetMouseButton(0) || Input.GetKey("s") && Input.GetMouseButton(0)
  13. || Input.GetKey("w") || Input.GetKey("s")) {
  14.  
  15.     if(movement.grounded == true) {
  16.         audio.volume = 1;
  17.     }
  18.  
  19.     else {
  20.  
  21.         audio.volume = 0;
  22.     }
  23. }
  24. else {
  25.     audio.volume = 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement