76
Ask a Question / Music tracks are overlapping
« on: January 13, 2016, 03:54:36 pm »
Hi!
I have a few music tracks that I want to play randomly (but without repeating) in my game. So, I wrote code (see attachment), not very elegant one but it works. I tested it by clicking on a button in the game which forces the code to run again. Everything seemed to work fine until I tried to run this code automatically. I used Event "When channel is done" and as result I have the code running and executing these random without repeatings tracks, but they are overlapping! It feels like this code wast trigged a few times at once. The oddest thing is, when I start the next scene I use command "stop sound on channel" before switching the scenes, and I have a stroke in the new scene which does "stop all sounds", but the music is still playing! How is this even possible? I used "stop sound on channel" and "stop all sounds" but it's still playing!
I have a few music tracks that I want to play randomly (but without repeating) in my game. So, I wrote code (see attachment), not very elegant one but it works. I tested it by clicking on a button in the game which forces the code to run again. Everything seemed to work fine until I tried to run this code automatically. I used Event "When channel is done" and as result I have the code running and executing these random without repeatings tracks, but they are overlapping! It feels like this code wast trigged a few times at once. The oddest thing is, when I start the next scene I use command "stop sound on channel" before switching the scenes, and I have a stroke in the new scene which does "stop all sounds", but the music is still playing! How is this even possible? I used "stop sound on channel" and "stop all sounds" but it's still playing!