Load AudioClip and play now working

I’m wondering why the following code isn’t working.

var jumpSound : AudioClip = Resources.Load("jump1", typeof(AudioClip));
	AudioSource.PlayClipAtPoint(jumpSound, Camera.main.transform.position);

I get “Object reference not set to an instance of an object” error. Any ideas what I’m doing wrong?

This is most likely because the Resources.Load is failing to find the audio clip. Make sure that the asset file is in a folder called Resources within the project folder, and that the name is correct (it must have the same upper/lower case as the name of the asset).

Oh, yeah the file is in just a random folder. Is there a way to load an audio file if it’s not in the Resources folder?