How can i get it so that when i have vertical and horizontal movement i play an audio clip.
I have this as my script but the audio is distorted and messed up. What’s wrong?
var walkAudio : AudioClip;
var isMoving : boolean = false;
function Update() {
if (Input.GetAxis("Horizontal") || Input.GetAxis("Vertical") )
isMoving = true;
audio.PlayOneShot(walkAudio);
}
That code doesn't distort audio. Have you checked the import settings on the audio file? Is your bitrate correct?
– Loius