Forum rules - please read before posting.

"Play across scenes?" issue

edited June 2022 in Technical Q&A

Hey! I have a sound object in scene #1, and I'd like it to survive across scenes. I moved it to the root of the scene hierarchy, and selected "Play across scenes"? When I switch to scene #2, the object survives, but when I move back to scene #1, it disappears and no sound is played. If I switch to scene #2 again, and then back to scene #1, then it starts working again. I suspect the issue is having the object under "DontDestroyOnLoad" and then moving into a scene where the object already exists.

Is this a bug? Or am I doing anything wrong?

Ideally, I'd like all my scenes to have this object (so it doesn't matter which scene the game starts at), and I only want it to survive because I don't want a gap while switching scenes.

Comments

  • The Music and Ambience track options were created to get around this limitation. They can be used to handle the playback of music and SFX across scenes automatically, without having to place down and manage Sound objects in scenes.

  • edited June 2022

    Thanks, Chris. The issue is that I have a couple of concurrent ambience tracks that need to survive, and I manipulate them using mixer groups depending on where the player currently is (so crickets or birds sound muffled when the player is inside a house, etc). The 1-track limitation for ambience and music wouldn't work for me.

    But if anyone else is reading this and looking for a similar solution, I added those sound objects as children to the player prefab, and since my game doesn't use multiple players, this works perfectly.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.