Music bug

Hi everyone!
I have a problem with music playback in Unity. The loop gets muted at ~33 seconds (doesn’t matter wheter it’s the first cycle or any other) and unmutes only if the scene reload process is triggered. The bug exists in all scenes both in the Editor and in the built game client and depends only on the scene play time.
What can be causing it (and is there a way to fix it)? Attaching the AS panel part, maybe it helps.
image

UPD: It has somehow connected to priority and other sounds. I’m using engine sound system from the Project Boost section:

void StartThrusting()
    {
        rb.AddRelativeForce(Vector3.up * mainThrust * Time.deltaTime);
        if (!audioSource.isPlaying)
        {
            audioSource.PlayOneShot(mainEngine);
        }
        if (!mainThrustParticles.isPlaying)
        {
            mainThrustParticles.Play();
        }
    }
      void StopThrusting()
    {
        audioSource.Pause();
        mainThrustParticles.Stop();
    }

And everytime I press space the sound gets louder and louder. It seems that engine tracks are stacked up unless they occupy the whole project.

I solved this by changing audioSource.Pause(); to audioSource.Stop();
Since we’re talking engine thrust it’s quite logical that the engine starts sounding from the beginning of the track. And with a good loop, noone will hear any seams.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms