No sound being played underwater with Underwater Bubbles

hoodoo

New member
Not sure what's going wrong. I'm using this with a first person setup, and I can see the Bubbles particles in a Scene tab, while playing the scene with the player underwater. But I never hear any sound. The sounds do work well entering the water and on the water surface when swimming on the surface. Any ideas on what to try? Thanks!

1580096703569.png
 
Good catch - the audio was only being called once and then not again. You can fix this by changing the following on line 70 of WaterEffect.cs:
Code:
            m_AudioClipSet.PlayAtPosition(position);
        }
to:

Code:
            if (m_Continuous) {
                PlayAudioClip();
            } else {
                m_AudioClipSet.PlayAtPosition(position);
            }
        }

        /// <summary>
        /// Plays the AudioClip at the particle location.
        /// </summary>
        private void PlayAudioClip()
        {
            if (!m_Playing || m_Particles == null) {
                return;
            }
            var audioSource = m_AudioClipSet.PlayAudioClip(m_Particles.gameObject);
            if (audioSource == null || audioSource.clip == null) {
                return;
            }

            Scheduler.Schedule(audioSource.clip.length, PlayAudioClip);
        }
 
Top