Quantcast
Channel: Questions in topic: "walk"
Viewing all articles
Browse latest Browse all 88

Problem With Walking Sounds

$
0
0
When i use this code footsteps gets bugy when you press W and D at the same time walking sounds not playing sometimes. #pragma strict var Walk : AudioClip; function Update() { if (Input.GetKeyUp (KeyCode.W)) { audio.clip = Walk; audio.Stop(); } if (Input.GetKeyDown (KeyCode.W)) { audio.clip = Walk; audio.Play(); } if (Input.GetKeyUp (KeyCode.D)) { audio.clip = Walk; audio.Stop(); } if (Input.GetKeyDown (KeyCode.D)) { audio.clip = Walk; audio.Play(); } if (Input.GetKeyUp (KeyCode.A)) { audio.clip = Walk; audio.Stop(); } if (Input.GetKeyDown (KeyCode.A)) { audio.clip = Walk; audio.Play(); } if (Input.GetKeyUp (KeyCode.S)) { audio.clip = Walk; audio.Stop(); } if (Input.GetKeyDown (KeyCode.S)) { audio.clip = Walk; audio.Play(); } }

Viewing all articles
Browse latest Browse all 88

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>