Hey guys im playing one audio file as a BG music in a loop now i want to add sound effect to for collisionEnter event but im not able to get it
its just playing the BG music
its running the audio.Play() code but yet im not able to hear the sound effect.
i even tried playing with
gPacketAudio.audio.PlayOneShot(gPacketAudio.audio.clip, 1.0F);
here is the part of the code:
public Collider gPacketAudio;
public AudioClip PacketAu;
void OnTriggerExit ( Collider collisionInfo ){
if(collisionInfo.name==“Packet”){
// gPacketAudio.audio.Play();
// audio.PlayOneShot( gPacketAudio.audio );
if(PacketAu){
// print(“\n pa”);
gPacketAudio.audio.PlayOneShot(gPacketAudio.audio.clip, 1.0F);
}
}
can anyone help me out with it???
would like 2 have a small demo as well if possible
Thanks