using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FootStepScript : MonoBehaviour {

    private AudioSource a;
    private AudioClip ac;

	// Use this for initialization
	void Start () {
        a = GetComponent<AudioSource>();
        ac = Resources.Load<AudioClip>("Sounds/footstep");
	}
	
	// Update is called once per frame
	void Update () {
        if ((Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.S)) && !a.isPlaying)
            a.PlayOneShot(ac);
    }
}
