4:20 if you don't need to change something there, just set the slider values from -80 to 0, this is a better solution because the log makes an arc in the graph and it does not work very well in places
8:06 the musicVolume is what controls the saving for the sfx? wont that cause problems? especially if you want to add other audio controls in the future
Couldn't figure out why mine wasn't working correctly to add other parts like having a main master slider and adding separate setting. I had to break the Has Key down into separate parts.
Hi, I hope you would have a video tutorial about that sound and sfx toggle inside the option panel (am I right? the one when user clicks the option button, I hope the toggle would show up there and user will be able to adjust the music and sfx even they are from different scenes)
I did the same, but for some reason it does not change volume. Where did you put the Audio Source? I did it like in your previous VIdeo in to "AudioManager" -> "Music" -> "AudioSource". I also bind the Output to music of the Mixer. Please help me...
Hi, I would like to know how to share the the volume between scenes for example if I have it controlling the volume on one scene and I change it to max, I want it to be max if I go to another level.
Hey, first of all thank you for the tutorial. I learned a new lesson in Unity. But I have one issue when I export the game and open it, the volume is set to 0% (it is muted). What should i do that when i’ll open the exported game the audio will be set to 100%?
Hello , if you update Start function like this I think you solve this problem Please feedback the result 😊 public class VolumeSettings : MonoBehaviour { [SerializeField] private AudioMixer myMixer; [SerializeField] private Slider musicSlider; [SerializeField] private Slider SFXSlider; private void Start() { if (PlayerPrefs.HasKey("musicVolume")) { LoadVolume(); } else { PlayerPrefs.SetFloat("SFXVolume", volume); PlayerPrefs.SetFloat("musicVolume", volume); LoadVolume(); } }
@@RehopeGames i was messing around with the slider in the editor and then i remembered that i set it to 0% so that’s why when i built the app it was set to 0% :D setting it to 100% fixed it but thank you for the answer!
Hey que tal? Buen video. Una pregunta, he intentado implementar varios puntos de carga y en un principio funciona, pero lo que no hace bien es pasar de un punto de carga a otro, me resetea la posicion a la inicial del objeto y luego si puedo llevarlo al nuevo punto de carga. Sabes a que se puede deber? Gracias!
Hey, ive been following the audio tutorials for my game, and its been working fantastically! One question that i have is that in my game i implemented the volume settings in my main menu scene as well as my game scene, and for some reason the game music will stack ontop even using the other video, which used the "DontDestoryOnLoad" function. Any ideas?
@@RehopeGames I used the video and followed it but, it still seems to repeat itself. I'm not sure if having the volume settings in multiple scenes affects anything?
Hi, I need some help. I made a script that looks similar to your, but instead of controlling AudioMixer, I controled AudioListener volume. The saving of the volume works, but when I open the settings, slider value doesn't save. Then I made everything like in your script (like controlling myMixer) and nothing changed, slider value doesn't save and I can't controll the volume untill I set Slider Event (OnValueChanged) again. Only then it works. I'll be glad if you help, I really need to solve this problem.
@@RehopeGamesYeah, hi again) To be more specific, here is the problem: when I want to test the game and try to change the value of the slider, it changes, but the value of the sound does not change. Then if I set the OnValueChangedEvent again in game mode as shown in the video, I can change the sound and everything works. Then if I exit game mode and come back in, the sound value is saved, but the same problem with the slider occurs. I can adjust it, but the sound value won't change until I set the Event again. Maybe it's some kind of bug in the editor, and when I build the game everything will be fine?
Hi, when I start to play game, I can't see the object that "DontDestroyOnLoad". I watched your previous video and I did step by step whatever yo did. But can't find when you add this object. Can you help me about this problem? Please :(
Merhaba Meryem hanım, "DontDestroyOnLoad" bir nesneyi sahneler arasında taşımamıza yarayan bir komuttur. Sahneler arasında yok olmayan bir nesneniz olduğunda onu hiyerarşi panelinde DontDestroyOnLoad altında görebilirsiniz. Bu arada eğer Singleton Patterni daha önce kullanmadıysanız bir göz atmanızı tavsiye ederim. Projenizde başarılar 🙏
For some reason when I turn the sliders all the way down, the volume gets automatically set to max even though the sliders are down. How do I fix this?
the code works fine in the play mode but when I export it as an apk for android, the volume adjustments doesn't work. Is there a setting in unity that I must change?
Exposed name does not exist: Music UnityEngine.StackTraceUtility:ExtractStackTrace () MenuController:SetMusicVol () (at Assets/Script/MenuController.cs:37) UnityEngine.EventSystems.EventSystem:Update () how can i fix that
these are the best unity audio tutorials anyone can find in youtube, i dont understand how you are not getting more views
Thank you so much for your feedback 🙏
You're so kind 😊
4:20 if you don't need to change something there, just set the slider values from -80 to 0, this is a better solution because the log makes an arc in the graph and it does not work very well in places
I always come back to this, THANK YOU BROTHER!
Thanks so much. Will keep visiting this channel for tips!
truly a legend. thanks so much for your tutorials!!
Thanks for your motivational feedback. 🙏
I'm glad hear that , I wish you success in your project 😊
Best Tutorial for Volume Slider
This is the only best unity tutorial channel 😍
8:06 the musicVolume is what controls the saving for the sfx? wont that cause problems? especially if you want to add other audio controls in the future
amazing tutorial! just what I needed, thank you so much! ♥
Hocam videolarınız gerçekten mükemmel ve öğretici Eliniz sağlık
Muchas gracias por la magnifica explicación, entendí muy bien aunque no me quedó muy claro lo de mathf.log, Saludos,
Hi! I have a problem at 6:43. the volume is not saved and it reverts to default settings.
Is there any solution?
I have done all the steps.
on SFX it can be saved, but on music it cannot be saved
Couldn't figure out why mine wasn't working correctly to add other parts like having a main master slider and adding separate setting. I had to break the Has Key down into separate parts.
Like this:
private void Start()
{
if (PlayerPrefs.HasKey("MasterVolume"))
{
LoadVolume();
}
else
{
MasterVolume();
}
if (PlayerPrefs.HasKey("MusicVolume"))
{
LoadVolume();
}
else
{
MusicVolume();
}
if (PlayerPrefs.HasKey("AmbientVolume"))
{
LoadVolume();
}
else
{
AmbientVolume();
}
if (PlayerPrefs.HasKey("SFXVolume"))
{
LoadVolume();
}
else
{
SoundFXVolume();
}
}
👍
Hi, I hope you would have a video tutorial about that sound and sfx toggle inside the option panel (am I right? the one when user clicks the option button, I hope the toggle would show up there and user will be able to adjust the music and sfx even they are from different scenes)
Yes You are right sir. I will do it , Thanks 😉
I did the same, but for some reason it does not change volume.
Where did you put the Audio Source?
I did it like in your previous VIdeo in to "AudioManager" -> "Music" -> "AudioSource".
I also bind the Output to music of the Mixer.
Please help me...
Is it normal for the music volume to adjust to the volume of the sound effects when exiting and re-entering the game? And if not, how can it be fixed?
Does it work on one scene or all the scenes in your project?
Hello ,
You can create a Prefab from the object and you can easily add the scenes you want.
Hi, I would like to know how to share the the volume between scenes for example if I have it controlling the volume on one scene and I change it to max, I want it to be max if I go to another level.
Another example is that i want the audio to be changed for all the scene love your videos btw supper helpful
Sorry it was a problem on my end i needed to make sure the Audio sources were connected to the Audio mixer.
Hi, did you finish this series? ua-cam.com/play/PLf6aEENFZ4FuL4XSo0rEUgecY7FED8p-I.html
Great tutorial, keep it up!
Hey, first of all thank you for the tutorial. I learned a new lesson in Unity. But I have one issue when I export the game and open it, the volume is set to 0% (it is muted). What should i do that when i’ll open the exported game the audio will be set to 100%?
Hello , if you update Start function like this I think you solve this problem
Please feedback the result 😊
public class VolumeSettings : MonoBehaviour
{
[SerializeField] private AudioMixer myMixer;
[SerializeField] private Slider musicSlider;
[SerializeField] private Slider SFXSlider;
private void Start()
{
if (PlayerPrefs.HasKey("musicVolume"))
{
LoadVolume();
}
else
{
PlayerPrefs.SetFloat("SFXVolume", volume);
PlayerPrefs.SetFloat("musicVolume", volume);
LoadVolume();
}
}
@@RehopeGames i was messing around with the slider in the editor and then i remembered that i set it to 0% so that’s why when i built the app it was set to 0% :D setting it to 100% fixed it but thank you for the answer!
i guessed that 😊
You're a legend! you'll get 50% on my game when it finishes :p
Hey que tal? Buen video. Una pregunta, he intentado implementar varios puntos de carga y en un principio funciona, pero lo que no hace bien es pasar de un punto de carga a otro, me resetea la posicion a la inicial del objeto y luego si puedo llevarlo al nuevo punto de carga. Sabes a que se puede deber? Gracias!
Gracias por tu buen comentario. resolviste el problema?
Hey, ive been following the audio tutorials for my game, and its been working fantastically! One question that i have is that in my game i implemented the volume settings in my main menu scene as well as my game scene, and for some reason the game music will stack ontop even using the other video, which used the "DontDestoryOnLoad" function. Any ideas?
did you watch this video ua-cam.com/video/xswEpNpucZQ/v-deo.html
maybe you can find solution in this video
@@RehopeGames I used the video and followed it but, it still seems to repeat itself. I'm not sure if having the volume settings in multiple scenes affects anything?
Ah. It was an issue on my end. It works perfectly now. Great videos btw!
I'm glad that you solved this problem 😊 and thanks 🙏
i cant save the sound when i exit the game, it turn back to default settings
Did you follow the video step by step?
i have the same issue
@@RehopeGames yep, every step
can you do the same thing with master audio? thenk you.
Hi, I need some help. I made a script that looks similar to your, but instead of controlling AudioMixer, I controled AudioListener volume. The saving of the volume works, but when I open the settings, slider value doesn't save. Then I made everything like in your script (like controlling myMixer) and nothing changed, slider value doesn't save and I can't controll the volume untill I set Slider Event (OnValueChanged) again. Only then it works. I'll be glad if you help, I really need to solve this problem.
Hi , Can I see your script ?
A send you a email message because idk why but I had some issues with UA-cam comments. Pls check it out.
@makkertop Hello again,
I just checked the mail. Everything looks fine in your code.
When you move the slider the volume changes but did not save ?
@@RehopeGamesYeah, hi again) To be more specific, here is the problem: when I want to test the game and try to change the value of the slider, it changes, but the value of the sound does not change. Then if I set the OnValueChangedEvent again in game mode as shown in the video, I can change the sound and everything works. Then if I exit game mode and come back in, the sound value is saved, but the same problem with the slider occurs. I can adjust it, but the sound value won't change until I set the Event again. Maybe it's some kind of bug in the editor, and when I build the game everything will be fine?
@@makkertop I am having exactly the same problem. Did you find a solution to this?
Thank you for the video
🙏
Hi, when I start to play game, I can't see the object that "DontDestroyOnLoad". I watched your previous video and I did step by step whatever yo did. But can't find when you add this object. Can you help me about this problem? Please :(
Merhaba Meryem hanım,
"DontDestroyOnLoad" bir nesneyi sahneler arasında taşımamıza yarayan bir komuttur.
Sahneler arasında yok olmayan bir nesneniz olduğunda onu hiyerarşi panelinde DontDestroyOnLoad altında görebilirsiniz.
Bu arada eğer Singleton Patterni daha önce kullanmadıysanız bir göz atmanızı tavsiye ederim.
Projenizde başarılar 🙏
Thank you!
You're welcome! 😊
Have a great day! 🌞
i used in main menu and game scenes, but in in game the save dosen't Work Like In Main menu what can I do for fix this issue?
Did you use same playerPrefs key in main menu and level menu ?
@@RehopeGames no
idk how to tell, but when the volume is low/muted then i start the game again, i hear some sound for 1 sec.. how to fix that
Hello,
Does the sound turn off after 1 second?
And did you follow me step by step ?
@@RehopeGames yes, the sound turn off after 1 sec but its really bother xD. I was follow step by step
@@xiaxiaxo Hi, I have the same problem. Did you find a way to fix this?
@@jycounnet still dont know to fix that
For some reason when I turn the sliders all the way down, the volume gets automatically set to max even though the sliders are down. How do I fix this?
Doesn't the slider automatically go to the last save level when the game is started?
Can you show me the script pls
Nevermind I fixed it. Thanks for responding so fast anyways though.
the code works fine in the play mode but when I export it as an apk for android, the volume adjustments doesn't work. Is there a setting in unity that I must change?
Hello, what problem do you have exactly?
Is the slider not moving or is there no change in volume?
Thanks dude!
Anyone know how to bring the volume to the next scene, for some reason the volume only works on 1 scene. Any solutions?
Hello , you can create a prefab from the object and then add the prefab to other scenes.
what is audioMixer? I was looking for a way to add music settings to my project and found this video, so I might be missing something.
Hi , I explained AudioMixer in this video ua-cam.com/video/IxHPzrEq1Tc/v-deo.html
Nice Video thanks!
how can i have audiomixer file? i only have music that i imported from assets for free.
Right click in the empty space and hover over create when it expands you'll find audio mixer below
when i start the volume is always on zero, even if i restart the game its zero.
someone plzzzzz help
does any one else have the problem on the sound not playing and the sliders dont work to lower and raise the volume
i cant find volume setting to set in functions
Hello , did you create VolumeSettins Script ?
dayı senin türk olmama ihtimalin yok
Kesinlikle 🤣
@@talha-r2v Çok teşekkür ederim , beğenmene sevindim 😊
PUAHAAHAAHAHJHHAHAHDHAH
si-cript
Hi Unity warning Can not play a disabled audio source.
Hİ ,
Control the the gameobject contain audioSource component in hierarchy panel.
if it is disable , enable it
3:30
🤔
😂
Exposed name does not exist: Music
UnityEngine.StackTraceUtility:ExtractStackTrace ()
MenuController:SetMusicVol () (at Assets/Script/MenuController.cs:37)
UnityEngine.EventSystems.EventSystem:Update () how can i fix that
Did you follow me step by step?