- Home /
Buggy inconsistent audio / Audio drops
Hi, I'm getting this issue where sounds don't always play but you can still hear their reverb with reverb zones? I'm using Unity 4.5.0f6.
Comment
if(Input.GetButtonDown("Fire1"))
{
if($$anonymous$$agEmpty==true)
{
AudioSource.PlayClipAtPoint(DryFireSound, transform.position, 1);
}
if(IsAttacking==true)
{
AttackAudioSource.Play();
if($$anonymous$$uzzleFlash==true)
{
Attack$$anonymous$$uzzleParticle.enableEmission=true;
}
}
}
if(Input.GetButtonUp("Fire1"))
{
IsAttacking=false;
AttackAudioSource.Stop();
if($$anonymous$$uzzleFlash==true)
{
Attack$$anonymous$$uzzleParticle.enableEmission=false;
}
}
The AttackAudioSource is set to loop.
maybe check if it is not instantiating several audio sources when "Fire1" is triggered.
when using this kind of trigger you should check "isPlaying" variable before playing anything on an audio source.
Your answer
Follow this Question
Related Questions
Potential Bug in Audio Compression Settings 1 Answer
Pick up script goes straight to drop action 0 Answers
Audio Artefacts When Stopping/Destroying during play. 2 Answers
Audio Listener Problem. 0 Answers