Music restart on new scene

guillefaceguilleface Member, BASIC Posts: 1,039

Hi, i try all methods but no matter what i do my main track music restart every new scene, i need same music to keep playing till the game finish. Any help will be great ,thanks

Comments

  • ArmellineArmelline Member, PRO Posts: 5,432

    Did you definitely add the music as music and use the "Play Music" behaviour and not add it as a sound and use the "Play Sound" behaviour? The "Play Music" behaviour should persist across scenes, but "Play Sound" will "restart" every scene change. The downside of "Play Music" is that only one music track can play at a time, so sometimes people use "Play Sound" not realising it isn't the same thing.

  • guillefaceguilleface Member, BASIC Posts: 1,039

    thanks for you help, but yeah i try both , play music and play sound, but i think the problem was i had the play music on this actor that is on every scene, so i guess everytime the scene loads , this actor will play song form beginning, so beside my main track, i have a second one that only plays 1 time for 30 seconds. i set my rule to when player enter this room,

    when enter.room = true

    pause music

    then to play this second track

    but is making the game stays in a loading screen for ever.

  • guillefaceguilleface Member, BASIC Posts: 1,039

    Iam doing a escape game , basically it has 8 scenes, main track needs to play on all of them without reset, but only when i enter this special room i need to pause music, play a new song for 30 seconds, after that, game resume with main song, whats the different between pause and stop music attribute? I used both but i cant get it to work.

  • ArmellineArmelline Member, PRO Posts: 5,432

    If you're retriggering the Play Music every scene, that would definitely restart the track each time. It would depend on exactly how you have things set up, but I'd probably set an attribute called "Music Playing" or something when the music is first triggered, and have music only be triggered if that's 0. Then on the special room, trigger the new music, set "Music Playing" back to 0 after 30 second and have the original music resume playing. Or something along those lines, depending on the setup.

  • ArmellineArmelline Member, PRO Posts: 5,432

    Here's a demo. It's little more complicated than it needs to be because I wasn't sure if you're letting the player leave the scene before the 30s is up or not. This handles it if you do. If they can't leave the scene for those 30 seconds, it makes things even simpler.

    If you specifically wanted to resume the original track from the place it was left off, that changes things, though. You can't play one music track, then swap to another, and then resume the original at the place it left off. You'd have to make the second music track a sound, and pause the main music track, then play the sound, then resume the original music track.

    I'm probably overcomplicating things trying to make this work for any interpretation of what you said, but hopefully these two are enough for you to figure out how to implement it for your specific use-case.

  • guillefaceguilleface Member, BASIC Posts: 1,039

    Ok thanks alot ian not in my pc right now, but i check it tomorrow, also it could be that i just noticed my sounds and music are mp3 or wav, i think i need my track to be ma4 , iam also going to use that format tomorrow,

  • ArmellineArmelline Member, PRO Posts: 5,432

    GameSalad will convert your music into the correct formats (in most cases) so you should be fine using whatever you have!

  • guillefaceguilleface Member, BASIC Posts: 1,039





    i think it has to be the web creator version, its giving me so many glitches since i started use it. i try your method on the desktop version and everything works fine, i think the problem is on the web version the play music does not open the tabs to choose my song like it does on the desktop version, i can type the name of the song and it plays but i think still there is something wrong with it. now i dont know if i should open my file on the desktop but i dont want to mess up my whole game.

  • ArmellineArmelline Member, PRO Posts: 5,432

    I'm afraid you'll need to get @adent42 to help you there, I'm not sure how it works in the web creator.

Sign In or Register to comment.