How do I make my music fade out?

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

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited February 2014

    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

  • SocksSocks London, UK.Member Posts: 12,822
    @gyroscope
    @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.
Sign In or Register to comment.