How to fade out music while next scene loading? Thread?
Asked Answered
G

6

0

Trying to figure out if it's possible to have music fade out (which works) but the fade tween doesn't apply when a next scene is loading, and that stops the tween from processing.

Is there a way around this? Do I have to use a thread or can I set something on the AudioStream/Tween to work in background?

Groff answered 15/5, 2023 at 12:51 Comment(0)
A
0

Is the issue that the AudioStreamPlayer is in a scene that gets freed when you load the next scene? If so one option might be to handle the music in an autoload so it sticks around even when you change scenes.

Ample answered 15/5, 2023 at 18:7 Comment(0)
Z
0

Ample If so one option might be to handle the music in an autoload so it sticks around even when you change scenes.

This is what I’ve done several times to have audio fade or persist across scenes. I’d recommend using an auto load if you can.

Zaneta answered 15/5, 2023 at 21:9 Comment(0)
E
0

You probably want your own scene loader if you want better control.

https://docs.godotengine.org/en/stable/tutorials/io/background_loading.html

Educationist answered 15/5, 2023 at 21:40 Comment(0)
G
0

Ample

Yes it's already in an autoloaded singleton

Groff answered 16/5, 2023 at 4:15 Comment(0)
G
0

Educationist

I'm not sure if I can add resource loading in my project at this point... too many global variables being altered when I load a level

Shouldn't it be possible to thread a tween instead?

Groff answered 16/5, 2023 at 13:57 Comment(0)
M
0

you don't need a thread, a single tween in autoload is enough

Marlin answered 9/7, 2023 at 9:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.