How to continue playing music after switching to another scene?

dareek

  • Posts: 91
I want to start music in 'scene 1' then switch to 'scene 2' and hear the music continue  to play until I make it fade out.
No matter what I try now, the music stops abruptly at switching to 'scene 2' point.

colburt187

  • *
  • Posts: 2416
so you want the music to be constantly in the background throughout the 2 scenes. It should happen automatically, make sure you don't have a stop all sounds block in your switch scene behaviour.

dareek

  • Posts: 91
Interesting. I don't have a 'stop all sounds' block in 2nd scene.
I wanted the music to fade gradually after scene switching, so I used in scene 2 'fade out sound on channel 1 (the same channel I started to play in 'scene 1') over 5 secs' block, but is does not fade out, just ends abruptly.

I switch scenes with actor's event. When the mouse is pressed on actor > switch to scene 2 and crossfade for 0 secs.

colburt187

  • *
  • Posts: 2416
that should work, are you fading it out in a when created block in scene 2?

dareek

  • Posts: 91
The 'fade out sound on channel 1...' block is placed in the 'When created' Event of the scene 2.

I did some experimenting. I removed fade out block and the sound did not continue to play at the scene switch. This time it was playing but always restarting at the scene switch

You say it should smoothly continue to play through the scene switch? Strange.

colburt187

  • *
  • Posts: 2416
yep, if you loop your music in the first scene it should continue to play throughout all scenes until you tell it to do otherwise.

dareek

  • Posts: 91
Back to the drawing board trying to find where my mistake hides.
Thanks for your help.

sdieters

  • Posts: 2068
in this part of my create an RTS tutorial serie i explain how to make your music loop trough multiple scenes.
> https://www.youtube.com/watch?v=VFsPF9PLMW4
the music part starts around 20 minutes.

Good luck!
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

dareek

  • Posts: 91
Thanks sdieters,
Great tutorial.
Watching it and checking my code helped me to find that forgotten part of code under the actor event that messed things up with the sound.