My audio clip was working just fine yesterday. Today I load my scene and the audio has stopped working. I checked everything and it was all the same. The listener is checked, the audio source is there and checked, the code has not been changed and for some reason it will not play.
I have it set up so the audio plays when the player clicks the space bar, a jumping sound, the audio plays one time for 1st jump and 1 time for 2nd jump then stops.
For some reason it has stopped working.
Does anybody know what this might be?
Here is the script that I use to play the audio
void Update ()
{
if ((grounded || !doubleJump) Input.GetKeyDown (KeyCode.Space))
{
anim.SetBool ("Ground", false);
rigidbody2D.AddForce (new Vector2(0, jumpForce));
audio.Play();
if(!doubleJump !grounded)
doubleJump = true;
}
}