My music volume slowly gets louder until a SFX is played
I'm a newbie using Javascript in Unity 5.4.1. If I set the volume of my music to be very quiet (but not off), when I start the next level, the music will slowly get louder if I don't move my character (rolling ball).
As soon as I hit an object with the ball, the music volume drops back down - as if having a sfx play will cause the music to drop back down.
My AudioSource is set to 2D. My listener is on my Main Camera. Here's a snapshot of the inspector on my music.
This problem does not occur if I set the music volume to off.
When you play the scene, do you see the Volume slider move up on its own? or does the slider stay the same, just the sound itself is getting louder?
What I don't understand here: Do you actually manipulate the music volume somehow through code or is it doing this by itself?
The problem was occurring by itself. I don't have any code that adjusts the music volume.
It didn't occur to me to turn on the slider (normally it's hidden). After reading Cynikal's comment, I turned on the slider. Unfortunately (or maybe fortunately), I can't repeat this bug anymore. Late last night (after asking the question), I went thru all my levels and reconnected my music audiosource to the game object with the slider.
$$anonymous$$aybe that fixed the problem since I can't get to happen now. If it does happen again, I'll definitely turn on the slider and see if it moves.
Answer by Bwhang · Nov 05, 2016 at 09:21 AM
The problem was occurring by itself. I don't have any code that adjusts the music volume.
It didn't occur to me to turn on the slider (normally it's hidden). After reading Cynikal's comment, I turned on the slider. Unfortunately (or maybe fortunately), I can't repeat this bug anymore. Late last night (after asking the question), I went thru all my levels and reconnected my music audiosource to the game object with the slider.
Maybe that fixed the problem since I can't get to happen now. If it does happen again, I'll definitely turn on the slider and see if it moves.