Audio Source Array attached to camera
Good morning, after a long night of research, I have come to the community for guidance / help on this :(
The idea is pretty straight forward, attach multiple audio sources to the player's camera, so that when the player runs into a trigger source, I can control where the sound comes from in relation to where the player is looking. However, not only does the sound not play, I'm not even getting a trigger event in my Debug.Log :evil:
Here is the code that I am using on the trigger:
I select the sound, selected the audio source, and made sure that the box collider was set to isTrigger. It seems pretty straight forward, but I'm not having any luck :\
Any ideas? I'd be a happy panda if I could figure this out, lol
The idea is pretty straight forward, attach multiple audio sources to the player's camera, so that when the player runs into a trigger source, I can control where the sound comes from in relation to where the player is looking. However, not only does the sound not play, I'm not even getting a trigger event in my Debug.Log :evil:
Here is the code that I am using on the trigger:
#pragma strict
var audioFXClip : AudioClip;
var playOn : AudioSource;
private var hasPlayed = false;
function onTriggerEnter(){
Debug.Log("Player has entered the trigger area");
if (!hasPlayed){
playOn.PlayOneShot(audioFXClip);
Debug.Log("The audio has triggered");
hasPlayed = true;
}
}
I select the sound, selected the audio source, and made sure that the box collider was set to isTrigger. It seems pretty straight forward, but I'm not having any luck :\
Any ideas? I'd be a happy panda if I could figure this out, lol
