Best Way to Implement Music?
Hey everyone,
For my game, I have a scene in the beginning that determines if an attribute is at 0 or 1, if its at 0 it goes to lets say Scene A, and if it is 1 it goes to Scene B. I'd like both scenes to play the same music, but I would like this to flow a lot smoother. The problem is, sure I can get it to play music on Scene A, but after you complete Scene A, you end up at Scene B, and since I have it playing the same song, it cuts off where it was on Scene A and then resets at Scene B. Is there a way to make a rule if music is playing then do not play, or something? What is the smartest way to implement music without having a cut off/reset?
This might be a stupid question, but I'm very interested!
Thanks everyone,
Matt
For my game, I have a scene in the beginning that determines if an attribute is at 0 or 1, if its at 0 it goes to lets say Scene A, and if it is 1 it goes to Scene B. I'd like both scenes to play the same music, but I would like this to flow a lot smoother. The problem is, sure I can get it to play music on Scene A, but after you complete Scene A, you end up at Scene B, and since I have it playing the same song, it cuts off where it was on Scene A and then resets at Scene B. Is there a way to make a rule if music is playing then do not play, or something? What is the smartest way to implement music without having a cut off/reset?
This might be a stupid question, but I'm very interested!
Thanks everyone,
Matt
Comments
If you want it to keep playing when you go back and forth several times, you need to set up a boolean attribute. Have it called "playmusic" or whatever you want, then have a rule in Scene a that states…When attribute.playmusic is 'true' Play Music "track1" then have another rules that says, When attribute.playmusic is 'false' Play Music "track1" Then in Scene b, have a rule that says when you click the button to change scenes back to Scene a, to set the attribute.playmusic to false.
I think thats the way to do it, I'm not sitting in front of my GameSalad computer at the moment, but give that a try and see if it works.
Thanks a lot SlickZero!