SOLVED - how to attach sound in library to camera?

Hi all,

How can i attach a sound to my camera so it doesn’t become ‘3D’ sound?

So far i have this which works but i can figure out how to actually attach it to the camera through JavaScript

var sfx1 : AudioClip = Resources.Load("sfx1", AudioClip);
audio.PlayOneShot(sfx1, 30);

Ive tried to add:

Camera.main.transform.position

But it’s a no-goer :confused:

Any ideas?

Not just the camera, but you can add it to any object in the scene… Just add “Audio Source” component.
The camera may be having the “Audio Listener” by default… Why exactly do you need to add to the camera? To be able to her it throughout the scene? Then, just set the audio type as “2D”, and it will sound the same, no matter where that object is.

Thanks TSRajesh,

I was trying to find it on the camera :confused: Figured it out though, for those wondering, it’s on the audio file that you have to change 3D to 2D :wink:

Cheers