I’ve been looking through tutorials and tips for several hours but none of the solutions cover everything I need.
I want the music to play sequentially throughout the game, and to be able to switch to other songs and exclude selected ones. As if the player was running a playlist in Winamp in the background.
So, to have an impact on the playlist at every moment of the game, e.g. to scroll to the next song, I try to put the entire logic in GameInstance.
First I wanted to use Sound Cue with Concatenator, without Loop Node in it it worked, but with Loop Node it stopped working when I was loading a new level. For some reason, only when we create a reference (here SET Audiocompref) then it works without a problem;
However, I don’t know how to add the logic I care about here, how to change songs from the menu in the game?
Later I tried to create a playlist with songs and run them via scripts. This makes it easier to add logic and maneuver more easily. The problem is big, however, and there are two problems.
One is to determine when to change the track to the next one, Dispacher OnAudioFinised for some reason just doesn’t work, after finishing the track it doesn’t start. Is it because it’s GameInstance?;
So instead I used SetTimerByEvent and set the length of the current song as its time;
This works, but when we minimize the game, the music stops and the event timer continues, causing the next song to start too early.
Moreover, when we stop the game using the SetGamePaused node, our event also stops, causing when the song ends the next track to start with a delay.
I don’t see a TickOnPaused option anywhere in GameInstance.
Please help.