- Home /
Question by
Shadehater · Jun 25, 2016 at 06:00 AM ·
androidsoundhang
Android : Game hangs for a second when first playing audio
Pretty much what the title says. It's just that the first time it plays it completely hangs the game for a second and then resumes normally. After that the sound is played exactly on time, no delay or anything Here is the code :
private int Score;
private AudioSource Source;
void Start ()
{
Source = GetComponent<AudioSource>();
Score = 0;
}
void OnTriggerExit2D(Collider2D other)
{
if (other.CompareTag("Score"))
{
Source.Play();
Score++;
Debug.Log(Score);
}
}
Comment
Best Answer
Answer by Shadehater · Jul 07, 2016 at 12:04 PM
Solved it by myself. It appears that Debug is the reason causing all this mess. It was happening for any event that had a debug line. Anyway, I just deleted every debug I could find and bam, it worked perfectly
Your answer
Follow this Question
Related Questions
Get Sound size Of Android Device 0 Answers
Why no sound on Android 1 Answer
Android, FMod and Unity 0 Answers
OnAudioFilterRead issues on Android? 1 Answer
Android sound distorted 2 Answers