Hello , i want to add footsteps sound to player
public float walkSpeed = 6.0f;
public float runSpeed = 10.0f;
public AudioClip[] dirt ;
void Update () {
if (!grounded && walkSpeed > 4) {
audio.clip = dirt[Random.Range(0, dirt.Length)];
audio.Play();
}
but sound only playing when i jump it's not playing while im moving any help would be great.
↧