Unity version: 2022.3.8f1
AC version: 1.81.3
I am trying to have a piece of music that plays persistently across scenes, but running into a problem.
Here is what I did so far:
Made a prefab called OldSchoolSoul that contains my sound. I added Adventure Creator->Logic->sound to it, checked “Play on Awake” and “Loop”, called it sound type “Music,” checked “Play While Game is Paused” and “Play Across Scenes”. I added the “Remember Across Scenes” script and manually assigned it a ConstantID.
In the scene in which I want the sound to start playing, in the OnStart menu, I did Object: Add and picked my OldSchoolSoul prefab.
Relevant screenshots: https://imgur.com/a/utOwH7H
When I run the scene, the sound does begin to play, which is great. But when I go to another scene, the sound goes away. Here is a video: https://www.youtube.com/watch?v=vPgM0ScXKpY
The reason I am trying to add a prefab is because the user is meant to come back to this scene. I wanted to avoid the issue where if you have a Sound object set to survive scene changes, then re-entering the scene it came from will mean you end up with duplicates as the Sound gets loaded in again as part of the scene data. (Following the advice in this thread)
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Is there a reason you're not using Sound: Play Music?
For me this works with the Sound: Play Music action in the Scene OnStart cutscene with the music set to "Loop" and "Resume if played before" enabled.
Thanks friends for your help.
Sound: Play Music was the very first thing I tried, but the situation I ran into was that, tho it worked in various other scenes, when I came back to the scene from which the sound was launched, it stopped playing. Here is a video illustrating the situation: https://imgur.com/a/8G3i71R
I'm also not seeing the "Resume if played before" option, Hexenwerk, so might be doing something wrong.
You have set the Sound action type to "Play" instead of "Play music". Try this, it should hopefully work then and you should get that option to resume.
Maybe you had set it correctly for other scenes but not for this one?
Yes - the "Sound: Play music" Action would be the Action to use here.
AC's music system is separate from the rest of the sound system, and automatically handles the playback of tracks across scenes (including revisiting earlier ones).
OMG HOW DID I NOT SEE THS OPTION BEFORE 🤡 🤡 🤡 Duhhhhhh it's right there!
Thanks for your help everyone. It works now.