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.
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.