How to use UI Slider to change the volume of Audio Sources across scenes - Unity Tutorial - 2019

How to use UI Slider to change the volume of Audio Sources across scenes - Unity Tutorial - 2019

Greg Eads

4 года назад

32,341 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@user-jjyyyyyy
@user-jjyyyyyy - 20.06.2023 14:56

I have a question. Where did you put your audio source? I don't know how to play soundeffects... audio source can't be move bc it's not a real audio source. How did you guys do this? I just left backgroundmusic play on awake and so it works well.
For example, if I push Shift the audio clip is different and when I walk it also has a different sound.

Ответить
@aldaashar6562
@aldaashar6562 - 16.06.2023 16:49

Thank you so much!!!!!

Ответить
@kris-rubensoly7283
@kris-rubensoly7283 - 04.05.2023 22:52

This worked fine a few days ago but all of sudden now all of my osund mutes by barely moving the slider 1%. Anyone knows why?

Ответить
@Nmbr1Gohra
@Nmbr1Gohra - 08.04.2023 08:28

great tutorial! One question though, in my game I have separate scenes (Menu Scene and Game Scene). My background music is in the game scene and my slider is in the menu scene. Im brand new to Unity so bare with me, but how would I be able to still connect the two and use the slider from the menu scene to change the volume in the game scene? (hopefully you see this lol its been 3 years)

Ответить
@randellty9868
@randellty9868 - 19.03.2023 12:36

How about if I want to have multiple background music for different scenes??

Ответить
@talismanskulls2857
@talismanskulls2857 - 28.01.2023 10:32

I know this is old but thought you might like to know, it still works in the current API. Good stuff.

Ответить
@awesome1337
@awesome1337 - 19.01.2023 02:59

What a legend! I tried so many ways before.... But this worked for every scene I got :D Thanks Man

Ответить
@tmdstv7815
@tmdstv7815 - 03.01.2023 08:11

thanks bro, your tutorial was great, help me well even its 2023

Ответить
@BigNatalie
@BigNatalie - 01.12.2022 02:39

How to make your exit button still have a sound when pressed, mine follow you everything, this button has lost the sound. Thank you very much your content really helped me a lot.

Ответить
@angiemon897
@angiemon897 - 26.10.2022 16:31

One question: why do 99% of all tutorials involving scripts not give us the script so we can copy it instead of having to type everything? (:
Serious question, that would make my life as an artist sooo much easier °^^ (not that I'm not grateful! <3)

Also: my Sound FXs are played across multiple audio sources, how would this work? 🤔
Ideally it would be a public value where I can drop all the prefabs that have audio players with sound FX, is this possible?
(I have a "code monkey" for the heavy lifting, however I want to do as much as possible on my own because after work and college most of the time he isn't the most motivated ^^)
(Like I don't get how to set up the sound, there's a general ambience sound played throughout all scenes, then music individually for every scene and all the Sound FX Audo sources (they are part of the prefabs (Player, Enemy AI, etc.)

Thanks!!! <3

Ответить
@reshinarutv
@reshinarutv - 12.10.2022 16:04

ty bro you saved my Life

Ответить
@pillowbear9762
@pillowbear9762 - 29.05.2022 15:36

your scrip don't connect to my music so only slider script works and not the volume changer help me

Ответить
@arunprakasam7603
@arunprakasam7603 - 06.04.2022 19:23

im using Fmod it worked for me too...thanks a lot...
I want to know one thing how to reset to first play in unity... cos i want to try that too... i want to check everythings works fine or not...
i mean, playerPrefs saves new modification... so how to reset again as new game...? is there any option available...?

-subbed.... :D

Ответить
@QuackImpala7321
@QuackImpala7321 - 14.01.2022 07:19

For some reason this is not working with prefabs when re-entering a scene. Is there any way to fix this?

Ответить
@Ayreontasia
@Ayreontasia - 02.12.2021 22:17

My audio sources are on a different scene from the sliders so I cant drag them to the script. Is there any workaround for this?

Ответить
@piyushrahi478
@piyushrahi478 - 30.11.2021 14:54

I tried this and wrote the codes just like you did but my background volume is not slowing down or increasing as i move the slider, its only pausing the output when i slide it to 0 that's it

Ответить
@filipdimitrievskicosmicvis7363
@filipdimitrievskicosmicvis7363 - 30.09.2021 12:36

Yo, how to tell the audio mixer what is sound effect

Ответить
@vressentials
@vressentials - 27.09.2021 19:21

Hey Greg, cool video, if u have a video on how to select a song in a song list, then play the song in the next scene with that song, like a rhythm game where u pick a song and play with that song, then that would be super sweet :)

Ответить
@damagamedev2818
@damagamedev2818 - 06.08.2021 15:06

you are BEST!!!!!!!!!!!! I subscribed you :)

Ответить
@transformers395
@transformers395 - 20.07.2021 10:07

Worked well in my project. thanks

Ответить
@furkansolak4086
@furkansolak4086 - 18.06.2021 19:05

When the music is over, I want it to repeat again, what should I do?

Ответить
@sybirathiallc1677
@sybirathiallc1677 - 03.06.2021 06:15

How do you use an Audio Mixer with this if you want to have 4 sliders (music, ambient, fx, npc) and a mute toggle?

Ответить
@BubbyGamingOfficial
@BubbyGamingOfficial - 01.06.2021 01:21

I need some help I've done the code but when I save it I get 2 warnings

1 being ;
2 being ','

Please Help me Someone

Ответить
@divinamaymedez7499
@divinamaymedez7499 - 15.05.2021 18:37

thank you so much!

Ответить
@andrewbracco4602
@andrewbracco4602 - 13.05.2021 21:04

Great tutorial

Ответить
@Daan-wl5gl
@Daan-wl5gl - 21.04.2021 04:20

Hey bro ...you have to also add ...save sound settings...on volume slider also..🤝🏻🤝🏻

Ответить
@aldinowildhankurniawan8175
@aldinowildhankurniawan8175 - 23.03.2021 11:30

i have question why try this volume not mute slider 0 ? can you help me

Ответить
@superangryowen2429
@superangryowen2429 - 16.03.2021 08:18

for some reason, there is an error in the continue settings part even though the script is the exact same

Ответить
@TheRealDuckMan
@TheRealDuckMan - 15.03.2021 21:44

For me doesn't work. Can I have the full code? A link for the full code? Imma Newbie.

Ответить
@SamuelAdomYG
@SamuelAdomYG - 12.02.2021 01:17

How about newbies? You did not begin with setting up of the sound channels in the first place.

Ответить
@tornikemeparishvili6704
@tornikemeparishvili6704 - 30.12.2020 00:28

thanks man you are the best just subscribed :))))

Ответить
@ecotextileStudio
@ecotextileStudio - 16.12.2020 03:25

Thanks for this awesome tutorial :)

Ответить
@Kaito_Shion73
@Kaito_Shion73 - 14.12.2020 10:33

One question, how could I make it so that from the other scene I can also use the slidders?

Ответить
@YoshioShion
@YoshioShion - 11.12.2020 14:48

The tutorial helped me a lot, in my natural language there are not many tutorials like that, thanks to you I can continue with my game :))

Ответить
@jakubpochron2667
@jakubpochron2667 - 02.11.2020 17:29

Awesome Tutorial!!!

Ответить
@ishanstuff
@ishanstuff - 02.09.2020 12:05

I need some help. I did everything but I can't move my slider

Ответить
@fotiniaggelaki5518
@fotiniaggelaki5518 - 27.08.2020 00:01

but what if I have different sounds on each scene and I still want to have the same settings for volume?
ps. I dont import all the sounds in the first scene
help pls

Ответить
@restuwibowo1555
@restuwibowo1555 - 16.08.2020 11:18

where is the coding DontDestroyOnLoad?

Ответить
@Brainyplanet
@Brainyplanet - 21.07.2020 13:55

Thanks So Much!!!!

Ответить
@cuie6967
@cuie6967 - 20.07.2020 01:08

So useful!!!!

Ответить
@yahyafarag5598
@yahyafarag5598 - 04.07.2020 00:52

I was wondering, if you have other sliders in other scenes (pause menu), how can you edit them also?

Ответить
@ziadadis
@ziadadis - 02.07.2020 17:50

OMG! This video was so helpful. Quick question on the music across all scenes, I seem to be having a hard time linking it back to the Game. Does the Audio Source need to be in the Game Scene instead of the Menu Scene? Because my Slider is on the Menu Scene, and there's no slider in my Game Scene.

Ответить
@jmarsify
@jmarsify - 15.06.2020 08:53

Hey love the tutorial! For some reason my soundfx aren't working properly....my music changes and saves to the next scene but my jump sound is still loud and clear no matter what! I've gone through the script several times and what's funny is, I used the script on a small test and it worked perfectly fine but when I implement it into my game only the music sound works. Any ideas or help?

Ответить
@icemochi5350
@icemochi5350 - 10.06.2020 11:52

Hi, the tutorial really helped me a lot! However I would like to ask, for this tutorial, sound settings can only be adjusted within one scene am I right? Because I realise if I move to another scene, I can't adjust the volume settings as how it is from the previous scene where the main script <AudioManagerTutorial> is in

Ответить
@bogdyrt513
@bogdyrt513 - 08.06.2020 17:05

i have an problem , my "switch between scenes " its not working and i did all fine but i think so its bc i dont need an sound effects slinder or sound effects and i didn implemented in these scripts could this be the problem?

Ответить
@diegoalvarez795
@diegoalvarez795 - 30.05.2020 08:29

<3

Ответить
@zorensingh2866
@zorensingh2866 - 27.05.2020 03:50

when I am trying to link my audio scrip to the slider and select update sound() and try the sliders they have no effect if you could help me I would be very grateful

Ответить
@ginovalerio6667
@ginovalerio6667 - 16.05.2020 14:20

Very great tutorial it works all fine really appreciate thx!!


May I ask you one thing? How do you handle playOneShot for buttons? I'd like to do it in my game and add more audio like "hitAudio' for my player once when it gets hit...

Ответить