Can Gdevelop loop a song from a certain point?

In the NES track below the first 12 seconds play once, when the song loops it cuts those first 12 seconds. Can we do something similar in GDevelop?

1 Like

Hello!

Yes. Make sure you are playing the music on a channel (using either the “play sound on a channel” or “play music on a channel” actions), then you’d have a separate event with the “Playing offset of the music on a channel” condition, or the similar condition for Sound.

Make sure you select the same channel in question, the seconds you want it to loop after (not loop to), and make sure you select greater or equal to. This last part is important because not every portion of every second will happen during a frame, so it might not be exact.

Then for actions you just use the “Playing offset of the music on a channel” and set where you want it to loop to.

2 Likes

Thank you! I having music made as we speak so this is good to know!

1 Like

This is just what I needed (both the looping tutorial, and the music example, the more Spark Man Stage, the better)!

1 Like

Hey, do you think you could show an example? I tried it myself, but it doesn’t seem to work.

I have a project with this already set up.

Note: Since it’s in seconds, it doesn’t have to be integers. Instead of 103, it could be 103.496 if you’re needing it to loop at 103 seconds and 496 milliseconds.

ok, got it.
thanks for the code.