Hello,
I have recently managed to implement pausing into my game via the use of the “pause and start a new scene” feature. During the time the game is on the pause scene, all sounds on channels are paused, and when you return to the previous scene, ideally, all sounds that were previously playing go back on.
However, when you go back to the game after pausing, any sound effect that was played on a channel but had ended before pausing plays again unprompted. How do I fix this so sounds do not instantly play when the scene continues?
Here are some pictures for reference:
This event is from the scene that the pause screen is on. It is the only place in the scene that sounds on channels, let alone sounds, are mentioned.
These events are from the scene where the gameplay takes place. The object Unpause_VisionBlock is a black screen that is created whenever the scene resumes from the pause screen, and once it fades out, the game un-pauses.
Notice the sounds on channels are set to resume, not play again, so the fact that they play again whenever you un-pause is a problem.
It is also worth noting that if pausing stays on the scene with the gameplay, the issue still happens, and any previous sound effect plays again as soon as the game continues.
So, what am I doing wrong here? Is there a different action for sounds on channels I should be using? Should I arrange the actions differently? Something else? Please let me know, I’m completely lost here.
To be clear, when you pause and change the scene, the scene your changing to, you checked off the “Stop all sounds at the start of the scene” from the scene properties right?
EDIT: Also, have you checked the events that are triggering the sounds in the first place?
The resume sounds seem fine, maybe its what ever starts the sounds in the first place that after the scene is resumed get triggered again.
Conditions like “Trigger Once” arent global, meaning when you go back to the scene they can trigger again, there might be some shananigans going on with that
Yes, the “stop all sounds” option is checked off for both scenes.
I’ll look into seeing what events cause the sounds to play, though. Maybe I can change them around or pair them up with something else to fix this problem. Thanks for the insight.
I’m a bit unfamiliar with scene changing with resuming sounds, so I did some testing and it was chaotic.
When a sound finishes playing it seems to show both as stopped and paused. So, when you return to the scene the channels show paused as long as a sound was previously played. IDK if this is a bug or used to keep the sound loaded. Or maybe I’m doing something wrong. Resume sound was a bit confusing to me because it behaves just like play action and resumes/restarts whether the sound is paused or not. Again, maybe it’s me.
Anyways, I ended up adding an array scene variable, adding the paused channels to the array and then using the array to resume the sounds.
I simplified the events using repeat and a counter variable. Just change the repeat number to the number of channels. I tested it with 3 sounds on channels 1 thru 3.
Again, this is a new concept to me, maybe there’s a simpler way.
2 Likes