How do I make my music fade out?
TaricProductions
Member Posts: 16
I have 2 scenes and I want to have music in the Scene 1 and when I enter Scene 2, the music will slowly fade out.
Like this:
Start game -> Go to scene 1 -> Music will start playing -> Press "Play button" -> Scene changes from "Scene 1" to "Scene 2" -> When I enter "Scene 2" the music will start fading out
Like this:
Start game -> Go to scene 1 -> Music will start playing -> Press "Play button" -> Scene changes from "Scene 1" to "Scene 2" -> When I enter "Scene 2" the music will start fading out
Comments
Hi @TaricProductions Try the following in your scene 1 play button:
Rule: When touch is pressed
Interpolate attribute game.Audio.Music Volume to 0 Duration 3
Timer: After 3 seconds
Stop Music
Change Scene scene 2
--in your scene 2, in a blank actor at the side of the screen:
Change attribute game.Audio.Music Volume to 1
----------------
If, at any time, you have problems with this working in the viewer or an ad-hoc, try the following, slightly different, approach (although it does involve your music fading in the next scene):
Rule: When touch is pressed
Change Scene scene 2
--in your scene 2, in a blank actor at the side of the screen:
Interpolate attribute game.Audio.Music Volume to 0 Duration 3
Timer: After 3 seconds
Stop Music
Change attribute game.Audio.Music Volume to 1
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
@TaricProductions
Best to interpolate to -0.1 rather than 0 as this avoids the little glitch on the end of the interpolate algorithm - if you interpolate to 0 you can hear the music cut-out right in the tail of the fade.