How apply do not destroy on load to UI slider?

I had created a empty game object called “bgsoundcontroller” and attached script contain 2 parts.
(1)= do not destroy on load condition
(2)= public object slider and audio source.
To adjust volume of audio source through slider

But every time I change scenes, slider gets destroyed and background sound stop’s.

Hope I explained it clearly!!
Plz help!!

DondestroyonLoad works only for root objects so just try to creat script for each of your objects (audiosoure, slider). Script should look something like this DontDestroyOnLoad(gameobject).
Hope it helps