Sound Effect

I have searched all over, i cannot find a way to play a sound effect when my character jumps or walks. PLEASE HELP! here is my movement code

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

public class PlayerMovement : MonoBehaviour {

public CharacterController2D controller;

public float runSpeed = 40f;

float horizontalMove = 0f;
bool jump = false;
bool crouch = false;
// Update is called once per frame

void Update() {

horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;

if (Input.GetButtonDown("Jump"))
    jump = true;      

 if (Input.GetButtonDown("Crouch")) 
    crouch = true;
 } else if (Input.GetButtonUp("Crouch")) 
    crouch = false;

  void FixedUpdate ()
    //Move our character
    controller.Move(horizontalMove * Time.fixedDeltaTime, crouch, jump);
    jump = false;


You would do best to follow the short Unity tutorial on this subject. You can find it here.

In short, you need:

  1. An Audio Listener (there’s one on your main camera so nothing to do there)
  2. An Audio Source component, possibly on your player but often in a separate Audio Manager Game Object.
  3. An Audio file in the Assets, probably in its own folder (List of supported formats)
  4. A script that gets the component and issues audioSource.Play();

Edit: And if you want more on audio, read this article by the excellent John French.