Music Restarting Instead of Resuming

I’m trying to add a pause menu to my game which pauses/resumes music, however when resuming this game, the music is restarted instead of unpausing.

Here is a simple recreation of my events:

Edit: I accidentally put sound for the pause and resume in my recreation. They are all music in the actual project
Edit 2: Fixed! I changed it from music to sound and that did the trick

Music and sound have separate channels in GDevelop. And since at the beginning of the scene, a music starts playing, the other events must be pause/resume music on channel instead of sound.

Oops, that’s an error in my recreation. In the actual project they are all music, but the error persists

If you’re pausing / resuming a music, the event looks fine. The only possible issue would be with the “paused” boolean. I’m guessing other events that are linked to the boolean are causing this issue.

Try removing the “paused” is true / false conditions, to check if the music will work properly after that.

The paused bool is only to check if the pause menu is opened or closed
I removed it anyway, and it did not fix it

This is NOT to fis your issue
I am just sharing it as proper way to do 2 different things with one key/button

I̵ ̵j̵u̵s̵t̵ ̵t̵e̵s̵t̵e̵d̵ ̵i̵t̵ ̵o̵n̵ ̵t̵h̵e̵ ̵m̵o̵b̵i̵l̵e̵ ̵v̵e̵r̵s̵i̵o̵n̵.̵ ̵P̵l̵a̵y̵ ̵m̵u̵s̵i̵c̵ ̵o̵n̵ ̵a̵ ̵c̵h̵a̵n̵n̵e̵l̵ ̵d̵o̵e̵s̵ ̵r̵e̵s̵t̵a̵r̵t̵ ̵t̵h̵e̵ ̵m̵u̵s̵i̵c̵ ̵w̵h̵i̵l̵e̵ ̵p̵l̵a̵y̵ ̵s̵o̵u̵n̵d̵ ̵o̵n̵ ̵c̵h̵a̵n̵n̵e̵l̵ ̵c̵o̵n̵t̵i̵n̵u̵e̵s̵ ̵w̵h̵e̵r̵e̵ ̵i̵t̵ ̵l̵e̵f̵t̵ ̵o̵f̵f̵.̵ ̵B̵u̵g̵?̵

Edit: I meant to say I tested resume music and resume sound. The resume sound continues while the resume music restarted.

Here’s is a short explanation to the differences between Play Music and Play Sound

1 Like