So I’ve been trying to figure out how to play a sound clip that I imported into my resources.
how do I link my script
var merSound:AudioFile;
with the actual audio file called “mer”
So I’ve been trying to figure out how to play a sound clip that I imported into my resources.
how do I link my script
var merSound:AudioFile;
with the actual audio file called “mer”
Try this:
#pragma strict
function Update() {
if (Input.GetKeyDown(KeyCode.Space)) {
var ac : AudioClip = Resources.Load("mer") as AudioClip;
AudioSource.PlayClipAtPoint(ac, Vector3.zero);
}
}