How do I loop my music forever

0 favourites
  • 9 posts
From the Asset Store
For Adventure, Action, Heroes, Sci-fi and Action-RPG games.
  • I want my music to always loop regardless of anything, but whenever the layout starts or changes the music starts again, any help?

  • play the music in a blank layout only for sound maybe ?

  • You can use the tag in the music option for this. Whenever you play music, it gives you the option to place a tag to it. Than you could just use the tag to check if the music is playing.

    For example: Let's say your Music is titled "Music1", you can place in the tag section "Music1"

    Audio, If tag "Music1" is not playing (you need to select the playing tag and invert it)

    Trigger once:

    .....Audio Stop All

    .....Audio play Music1 lopping at volume -0db (tag "Music1"

    This way it detects if there is no music playing (first time) it will play the music, than each time you go back, since the music is still playing, it will not restart the music.

  • Dear all, I am struggling to find a solution: to have continuous music playing across different layouts.

    Is it possible to play a continuously looping track (tagged music) across different layouts or - as I am beginning to suspect - will the track have to be restarted upon a change of layout? This is a bit irritating because I want to have the same music track continue to play on layout 1 and layout 2; at the moment the music does not play if the layout is changed and it has to be restarted - this could be a few seconds after the game has started and looks (sounds) a bit unprofessional.

    Thanks for any help.

  • So.... Without changing anything, apart from doing a restart of C2, it all works as expected now...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Colludium, it should be able to play the same music across different layout, at least that is how it worked with my game.

    All I did was use the code I showed above. From my testing, C2 will continue to play the same track until it is told to stop. So if the start of your layout doesn't ask your music to stop, it should continue playing.

  • Start of layout

    .. Audio: X (inverted) Is "Music" Playing ? => Audio: Play your-music-file tag: "Music"

    Have this in your common event sheet or as Start of layout event for all your layouts event sheets, and it will do the job.

    It will only try to play the music when, on start of layout, the song isn't already playing.

  • Kyatric I was looking for this thanks

  • & rekjl - thanks for the replies. This is a bit hard to explain because I had it all set up correctly, indeed I've not had trouble doing this before on other games, but I couldn't get it to work this time around for some reason. I just wanted to see of anyone else was having the same problem because i was beginning to think it was a bug or possibly my own incompetence (I'm using r170 but I know that the audio plugin has not been touched...). Then I restarted C2 and the music now plays correctly....

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)