I'm making a game where each level has its own scene. When a level is completed it switches to the next scene and restarts the music that's playing. How do I make it so that the music plays continuously between scenes?

  • Add a manager scene, where stuff should happen independently from other scenes. You can set and remove scenes, but the manager should be kept as it is.
  • On the manager scene, add an object that receives messages, and each message sets a property named song to a integer number. You know, if a message sensor looking for song_1 message is activated, sets the property song to 1, and so on.
  • On the same object, make a logic to play each song (on loop stop mode) according to its property number. You know, if property song is 1, play song_1.ogg, and so on.
  • On each level, make an object send a message at startup to change the song. For example, Always > AND > Message with the subject song_1, and so on according to the level.

If everything went well, when a level restarts and the song is already playing, it shouldn't restart the song, and when the property song changes the object will stop the previous song and start the new one according to the logic.

Using this method of a manager scene also helps to keep everything on only one place, instead of looking for each scene to change the song or whatever.

| improve this answer | |
  • $\begingroup$ Sorry I'm a Blender beginner.. how would I make a manager scene? $\endgroup$ – Hoopla Mar 18 '19 at 0:51
  • $\begingroup$ It's a regular scene, but only named manager, just a convention. $\endgroup$ – Joel Gomes Mar 18 '19 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.