How to let music still play when I change scene?
Weiyu
Member Posts: 216
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
Comments
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.
I thought this was what play music behavior does??? Keep looping a song even if scene change.