GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to let music still play when I change scene?

WeiyuWeiyu Posts: 215Member, PRO
edited October 2016 in Working with GS (Mac)

Hello everyone!

I have a problem about music loop.

Even if I change scene, I will let music still play, not restart.

Could someone please give me some advice?
Thank you :s :'(

Comments

  • FeathersFeathers Posts: 31Member

    Here is an idea I haven't tried yet but will soon.

    Make a boolean attribute, 'Music on'(default: false.)
    Whenever an actor turns the audio file on change the attribute 'Music on' to true.
    Also, the music actor should have a behavior like this.
    If 'Music on' is false -> Turn audio file on (loop setting ticked)

    Don't save the attribute so this will happen whenever a player turns your game on.

    This way if there is an actor that turns the audio file on at each scene it may prevent the actor to restart an audio file.

    I haven't tested this but I'm guessing if you add this condition to your setting it would work, hopefully. If not, then too bad. I should come up with another idea. If there is an easier way I would love to know what it is thanks.

  • WeiyuWeiyu Posts: 215Member, PRO

    @Feathers said:
    Here is an idea I haven't tried yet but will soon.

    Make a boolean attribute, 'Music on'(default: false.)
    Whenever an actor turns the audio file on change the attribute 'Music on' to true.
    Also, the music actor should have a behavior like this.
    If 'Music on' is false -> Turn audio file on (loop setting ticked)

    Don't save the attribute so this will happen whenever a player turns your game on.

    This way if there is an actor that turns the audio file on at each scene it may prevent the actor to restart an audio file.

    I haven't tested this but I'm guessing if you add this condition to your setting it would work, hopefully. If not, then too bad. I should come up with another idea. If there is an easier way I would love to know what it is thanks.

    Thank you for your answer.
    I will try it. Thank you. :D

  • ToqueToque Posts: 1,180Member

    I thought this was what play music behavior does??? Keep looping a song even if scene change.

Sign In or Register to comment.