Hi, I'm trying to make my game's main theme play through the whole game. So, everything works fine carrying it over scenes and all, except for 2 scenarios.
1) Cutscenes. After the player clicks "New game" in the main menu scene, the game switches to the game scene and starts a cutscene. This is the only moment where I stop the music. I wanted to lower the volume instead, but since it's something the player will adjust in settings, I understand that it's not possible or harder. I'm fine with just stopping it, but problem is, after the cutscene, the music is being restarted. I tried both to use music: play with the "resume if played before" checkbock active, but this restarts it, and also tried using the "Resume if played before" method, and that one said there's nothing in the queue, and didn't play anything. Maybe stopping the music wasn't the way to go? I'm not sure how queueing works, if that's the solution. Here's images of the actions.
2) Saving and loading. When clicking "Back to main menu" from the pause menu, the music continues normally, all good. But when clicking "continue" from the main menu (so, when the game loads the previous save), the music goes back to where it was when the game was saved. Is there a way to prevent this from happening? I want the music to keep going.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Given the two issues, and the underlying scenario, I'd recommend not using the Music system - which is designed to be saved/loaded automatically in save-files - and instead manually play it from a single Sound object.
Add a Sound object, attach the "Survive scene changes" component, and give it the Music track. Make it a prefab, and remove from the scene. Add the Constant ID component and check Retain in prefab? so that Actions that reference it will rely on the scene instance at runtime.
Then, use the Events Editor to run an ActionList as part of the "Scene / Begin game" event, and have that spawn in the prefab and play the sound.
To have it dip the volume during the Cutscene, use the Sound: Change volume Action.