Music Controller problems

hi,

My name is Nico, this is my first time I post something on this forum.
I use unity not so long but I undstand the basics. I was trying to make a simple game with youtube help.
But when it was done I try to make a Menu and something more…
I spend now more than 5 hours for 1 problem. The problem is, I make a slider for set the music louder or softer. That was not difficult, but that music I want on other scenes too. With the self set volume and flow good over (so it don’t start at the begin of the sound when you switch to a other scene).

I can make the slider on every scene and there is everywhere music but I can’t control it.

I create 1 prefab with a canvas (so I can only see my slider). And my canvas have the sliderController script. My Main Cammera have the MainMenu script, so he spawn my prefab. The settings in my slider looks good becaus without the idea for use the music on every scene, it work.

ps: Give simple answers to me. I’m a beginner/amateur, if you say something difficult give a link or explain what it means. I realy like to know how this works (5 hours work for notting is stupid)

2262679–151423–MainMenu.js (557 Bytes)
2262679–151424–SliderController.js (124 Bytes)

by default when a scene is loaded everything is lost and the new scene is created.

this will stop the script it is used in from being destroyed add it to your music controller script where the volume variable is saved.

Thankyou, I will try it tomorrow!

Hi,
I have a second question, controll the music on every scene work and the music flow good over with no volume switch.
But I only want to see the music Slider in my Menu scene. So I try to move the slider in next scenes out of the camera view. I try many things but notting work. When I go back to my Menu scene I want to see my slider back but not on the other Scenes. Here you see my Scripts, if you don’t know what the problem is. Say than something about my contacting with you. because I realy don’t know or I’m good communicate (I’m clear, good enough English, to simple questions for this forum or to amateuristic)?

2264892–151615–MainMenu.js (961 Bytes)
2264892–151616–SliderController.js (472 Bytes)