SETTINGS MENU in Unity

Поділитися
Вставка
  • Опубліковано 20 сер 2024

КОМЕНТАРІ • 1,6 тис.

  • @tiggs_4429
    @tiggs_4429 3 роки тому +686

    by the way guys, if you cannot drag in the resolution drop down, you probably have a text mesh pro dropdown one. To solve this you can do 'public TMPro.TMP_Dropdown resolutionDropdown;' instead of the 'public Dropdown resolutionDropdown'. I hope this helps on anyone who is stuck.

  • @skho974
    @skho974 6 років тому +592

    Dude every time i need to learn something, i go on youtube and every time, you make a video about what i needed at that moment, you kidda scary tho

    • @richkid6571
      @richkid6571 6 років тому +1

      Lol yall crazy lol

    • @pitaya4151
      @pitaya4151 6 років тому +5

      Elvishious the fbi man tells him

    • @NicoFye
      @NicoFye 4 роки тому +5

      for everyone who's wondering, there is actually a tool that let's you know what people search the most :)

    • @ariarichards-
      @ariarichards- 4 роки тому +1

      @@NicoFye Yeah it's called Google trends

    • @echo9dev
      @echo9dev 3 роки тому

      @@ariarichards- yep

  • @GalanLefont
    @GalanLefont 3 роки тому +364

    0:00 Intro
    1:13 Volume
    5:36 Graphics
    7:48 Full Screen
    9:05 Resolution

    • @gaboandres
      @gaboandres 3 роки тому +3

      Thx man, now that they are not working as a youtuber anymore i dont feel guilty about not watching the whole vid lol

    • @cptray-steam
      @cptray-steam 3 роки тому +2

      Someone get this man a cookie!

    • @btryx9378
      @btryx9378 2 роки тому +2

      @Ninja Boy you're probably doing something wrong then.

    • @BigWallSolutions
      @BigWallSolutions 2 місяці тому

      С этой связкой все стало проще и эффективнее, спасибо за советы!

  • @Kai-Shin
    @Kai-Shin 6 років тому +466

    Small tip
    Select the audiosource you want to control volume > Output > None→Master(AudioMixer). :D

    • @Zinisco
      @Zinisco 6 років тому +6

      Thank you!

    • @FabioKun
      @FabioKun 6 років тому +3

      thx

    • @d1xt1r
      @d1xt1r 6 років тому +3

      Thank you!

    • @kevinalbajrami9923
      @kevinalbajrami9923 6 років тому +5

      make this top comment

    • @akulmehra7528
      @akulmehra7528 6 років тому +18

      Hey man, I followed the tutorial step by step and even followed your comment. Still my slider seems to have no effect on the volume. Any suggestions?

  • @_hallowed_
    @_hallowed_ 2 роки тому +179

    For the resolutions option, if anybody is seeing a lot of seemingly duplicate options (I was), it's because of refresh rates - you have 1920x1080@60hz and 1920x1080@144hz for example. What I did was add the refresh rate into the dropdown text options:
    string option = resolutions[i].width + " x " + resolutions[i].height + " @ " + resolutions[i].refreshRate + "hz";

    • @stentanner
      @stentanner 2 роки тому +4

      Thank you!

    • @_hallowed_
      @_hallowed_ 2 роки тому

      @WasNeverBrandon No idea, but there definitely is a way.

    • @Ice_ZOMBIES
      @Ice_ZOMBIES 2 роки тому +9

      I literally just switched back from my Unity program to google "why do i have duplicate resolutions?" Just to see your comment conveniently right before I clicked away. Bless your soul, you beautiful bastard! Thank you!

    • @Nikolai_SE
      @Nikolai_SE 2 роки тому

      Thank you bro!

    • @chiragmidha2878
      @chiragmidha2878 2 роки тому

      this is exactly what I was looking for

  • @patrickh4284
    @patrickh4284 6 років тому +449

    At 14:30 there´s a mistake in the script. He compares resolution[i] with Screen.currentResolution but that´s wrong. CurrentResolution gives the Resolution of the monitor but we want to compare it with the Resolution of the window in case we change the scene. That´s why we have to compare resolution[i].width with Screen.width and resolution[i].height with Screen.height.

    • @yeetusselfdefeetus4566
      @yeetusselfdefeetus4566 6 років тому +17

      Patrick H YOU HAVE SAVED ME THANK YOU VERY MUCH

    • @christossotirlis2247
      @christossotirlis2247 5 років тому +12

      i love you. this video assisted me in creating my first project and this was a huge stuck. thank you

    • @rockbolton8173
      @rockbolton8173 5 років тому +9

      Thanks a bunch man! i was wondering why my game kept resizing to full screen when I opened my settings lol

    • @budrys1356
      @budrys1356 5 років тому +10

      Could you copy full script with resolution for me, becouse im having some trouble.

    • @poteito9721
      @poteito9721 5 років тому

      love you my dude, you saved my life :D

  • @DawnosaurDev
    @DawnosaurDev 4 роки тому +237

    At 5:10 use
    audioMixer.SetFloat("Volume", Mathf.Log10(volume) * 20);
    instead since the audiomixer volume is not linear
    Edit: make sure the varibles match yours ie. same caps and spellings

    • @SkeeterMakesGames
      @SkeeterMakesGames 4 роки тому +4

      Thanks dude. Solved a problem I was having.

    • @kishiosakai2649
      @kishiosakai2649 4 роки тому +4

      Thank you!

    • @fuuuuuuuuuuuuuuuuuuuuuuuuu
      @fuuuuuuuuuuuuuuuuuuuuuuuuu 4 роки тому +64

      Thank you. For this to work the Slider object must have Min and Max values of 0.0001 and 1 respectively.

    • @facyual9061
      @facyual9061 4 роки тому +3

      @Zoom the second time its lower case

    • @facyual9061
      @facyual9061 4 роки тому +4

      this only works if you change the "Volume" to "volume"
      it took me 10 minutes to figure out that the "Volume" wasn't supposed to be caps.

  • @wifu-box266
    @wifu-box266 3 роки тому +18

    Just wanted to let you know your tutorials are phenomenal!
    I really appreciate the way you add in Debug.Logs as you go so we can see it working as we go rather than just hoping it all works at the end of the tute.
    Stay awesome man!

  • @Jasperkiller1
    @Jasperkiller1 6 років тому +376

    We asked for it, we got it, we enjoy it. :D

    • @brianmo2611
      @brianmo2611 6 років тому +1

      ...... This is hardly a settings menu, what about aspect ratio, AA, Different volume settings for like music/sfx/master volume, what about controler and keyboard binding, or what about SAVING the settings for the next time a player opens the game........

    • @esbenkran
      @esbenkran 6 років тому +9

      - Aspect ratio is just a modified resolutions dialog with resolution shown in lower fractions.
      - The AA can be accessed through the post-processing stack, which I believe he has done a tutorial on already.
      - The different volume settings would be done by sending AudioSource sounds to specific mixers instead of master (SFX mixer, Music mixer) and then modifying them instead of the master as he did in this video.
      - The controller and keyboard bindings can be accessed and modified (with much more work) through the Input class etc.
      - Saving the settings is just using PlayerPrefs, which he has done a tutorial on already.

    • @brianmo2611
      @brianmo2611 6 років тому

      Yes because telling someone what they are is totally the same thing as showing someone how to set them up........

    • @arey85
      @arey85 6 років тому +1

      Watch Brackey's high score tutorial and you have your answer for both how to save custom prefs into a prefs and load it back. In his previous tutirials you can also find the answer how to detect inputs, keyress etc and change those settings. Then just combine all of them together and you can get a fully functional options menu :)

    • @somnia3423
      @somnia3423 6 років тому

      brian ou have to learn a few things by you own...

  • @hplovecraftmacncheese
    @hplovecraftmacncheese 2 роки тому +22

    If your slider is affecting the audio mixer values but not changing the sound volume of your audio, you have to drag the mixer into the slot of your audio clip on the inspector to affect the actual sound of each clip.

    • @conors026
      @conors026 Рік тому +2

      I know this was 3 months ago but thank you so much

    • @BAGUETTEBOYyt
      @BAGUETTEBOYyt Рік тому

      thanks 👍

    • @polipoli23
      @polipoli23 11 місяців тому

      thank you so much

    • @mcsween4593
      @mcsween4593 4 дні тому

      I dont get what you mean where do i drag the audio mixer

    • @hplovecraftmacncheese
      @hplovecraftmacncheese 4 дні тому

      @@mcsween4593 It sounds like you have brand-new understanding of the Unity menus. I think you need to do more beginner-friendly tutorials to get better familiarity.

  • @horyzengm
    @horyzengm 3 роки тому +157

    Brackeys: Its an amazing pack thats free on the asset store
    The asset store: That'll be $25 please

    • @infleo23
      @infleo23 3 роки тому +4

      True, I dont know which asset to use...

    • @aminkafnaweez2595
      @aminkafnaweez2595 3 роки тому +14

      @@infleo23 bro u can just draw the them urself its easy
      :)

    • @bbugra3
      @bbugra3 3 роки тому

      @@aminkafnaweez2595 wait.. is it really easy???

    • @redgeoblaze3752
      @redgeoblaze3752 3 роки тому +25

      @@aminkafnaweez2595
      you underestimate just how bad some of us are at art.
      Or more importantly, how long it takes us to figure out some digital art programs.

    • @Hietakissa
      @Hietakissa 3 роки тому +9

      @@redgeoblaze3752 that is why all my menus consist of tmp text with a nice gradient and a dark semi-transparent panel underneath it. Good enough looking ui and it's really easy to make.

  • @MrAvatin
    @MrAvatin 6 років тому +44

    Probably one of the few youtubers who care about their subscribers and take their feedback!

  • @TNThead
    @TNThead 5 років тому +7

    For anyone with troubles in build where the options can get duplicated in the dropdown; this is in fact not a bug, it is due to the varying refresh rates available. Unity editor has a consistent 60Hz, but when an application is built, there can be multiple differing rates between the same resolution.
    A fix can be just adding the refresh rate to the option:
    string option = resolutions[i].width + " x " + resolutions[i].height + ", " + resolutions[i].refreshRate + "Hz";

    • @hepcecob
      @hepcecob 4 роки тому

      Is there a way to do it without the refresh rates? I tried comparing the old vs new value, got the drop down list to be only unique refresh rates... but when I select one, I guess it takes it's index form the drop down and applies it to the available resolutions.

  • @jaycesaerius
    @jaycesaerius 6 років тому +52

    You are the best, Brackeys !

  • @user-pt6gu4rd6w
    @user-pt6gu4rd6w 5 років тому +61

    Hi! Thanks for your video! I've got something you might find useful.
    Instead of this:
    if(resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height)
    You can use the Equals method:
    if(resolutions[i].Equals(Screen.currentResolution))
    It compares objects and returns true, if their fields are equal.
    Hope it might help someone to shorten their code!

    • @zacksima8333
      @zacksima8333 5 років тому

      Евгений Кучерявый I think == is an implicit .equals call so you can just directly use ==

    • @mr.fakeman4718
      @mr.fakeman4718 4 роки тому +1

      == is slower than .Equals, his comment deserves more likes.

    • @awawa5594
      @awawa5594 3 роки тому

      Do you still need the last 3 lines:
      m_ResolutionDropdown.AddOptions(m_Options);

      m_ResolutionDropdown.value = m_CurrentResolutionIndex;
      m_ResolutionDropdown.RefreshShownValue();

    • @AstraGamesStudios
      @AstraGamesStudios Рік тому

      @@awawa5594 yes

  • @dc37wwe2kmods
    @dc37wwe2kmods 4 роки тому +12

    For everyone who gets the same resolution on the dropdown even if they already changed it:
    This happens when on window mode. The Screen.currentResolution will get the 'desktop resolution' instead of the game's current resolution.
    To fix this, simply change:
    ` if(_resolutions[i].width == Screen.currentResolution.width && _resolutions[i].height == Screen.currentResolution.height) `
    TO
    ` if(_resolutions[i].width == Screen.width && _resolutions[i].height == Screen.height) `
    If you didn't get it, change "Screen.currentResolution.width" to "Screen.width" (and also height) during the if statement on the for loop. This will get the game's current resolution.
    God Bless and Happy Coding! =)

    • @tophatsntales
      @tophatsntales Рік тому +1

      Holy hell this solved all my problems.
      it would save everything but as soon as a scene loaded it changed the resolution

    • @dc37wwe2kmods
      @dc37wwe2kmods Рік тому +1

      @@tophatsntales Happy to help!

    • @lazzzzz_exe
      @lazzzzz_exe 4 місяці тому

      what canvas settings did you have? mine doesnt scale properly and the resolution gets considerably lower if you pick anything but default

  • @skymartin9414
    @skymartin9414 2 роки тому +30

    If you are using a TextMeshPro DropDown instead of the default Dropdown change:
    public DropDown resolutionDropdown;
    to
    public TMP_Dropdown resolutionDropdown;
    and make sure that you have
    using TMPpro; at the top of your script

    • @janil9357
      @janil9357 2 роки тому +2

      wow.. thx a lot bro.. I was wondering what went wrong for a sec lol

    • @eltonyeo2811
      @eltonyeo2811 2 роки тому +2

      Thx, help me a lot

    • @noisefond
      @noisefond 2 роки тому +2

      legend

    • @savasozdemir3320
      @savasozdemir3320 2 роки тому +2

      I came here looking for a brave soul that solved my problem without me asking, internet delivered once again... Thanks man!

    • @kostiantynvolnov9012
      @kostiantynvolnov9012 Рік тому +1

      Thx, man, but 1 mistake using TMPro; without "p"

  • @Gredran
    @Gredran 4 роки тому +4

    It's true what they all say, you are THE Unity guy.
    Sure I know others exist, but the sheer amount of topics you discuss, from 2d to 3d, to settings and multiplayer. Thanks so much!
    It's been long overdue for me, but FINALLY getting into Unity and C# :D

  • @viktordjambov1437
    @viktordjambov1437 6 років тому +8

    If it weren't for Brackeys, not only would I have maybe thought about giving up Game developing, thinking it would be too boring or difficult, or I would have kept doing it but never find so much joy in learning the basics. Thanks man!

  • @jvcss
    @jvcss 6 років тому +39

    YOU ARE BADASS MAN!! I REALLY LOVE YOU DUDE!

  • @marcus_vdm
    @marcus_vdm 2 роки тому +13

    If you want to set the default quality to high for instance you can do that within the dropdown component by setting 'value' to 2. I struggled with this a bit at first :P

  • @81Mendel
    @81Mendel 5 років тому +8

    @ 11:45 - 12:13 try this line instead:
    string option = resolutions[i].width + " x "+ resolutions[i].height +" @ " +resolutions[i].refreshRate + " Hz";
    This will populate the list nicely with refreshRate information intact
    edit: not sure yet how to apply the refresh rate as well.

  • @likewut007
    @likewut007 5 років тому

    if brackeys doesn't have a tutorial on it, it can't be done. this guys saved me so many headaches

  • @Vaerch
    @Vaerch 6 років тому +2

    This is what i love about Brackeys, The quality of their tutorials.

  • @kralpata
    @kralpata 2 роки тому +9

    if anyone has errors in their script, try this:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.Audio;
    using UnityEngine.UI;
    using TMPro;
    public class SettingsMenu : MonoBehaviour{
    public AudioMixer audioMixer;
    public TMP_Dropdown resolutionDropdown;
    Resolution[] resolutions;
    void Start ()
    {
    resolutions = Screen.resolutions;
    resolutionDropdown.ClearOptions();
    List options = new List();
    int currentResolutionIndex = 0;
    for (int i = 0; i < resolutions.Length; i++)
    {
    string option = resolutions[i].width + "x" + resolutions [i].height;
    options.Add(option);
    if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height)
    {
    currentResolutionIndex = i;
    }
    }
    resolutionDropdown.AddOptions(options);
    resolutionDropdown.value = currentResolutionIndex;
    resolutionDropdown.RefreshShownValue();
    }
    public void SetResolution (int resolutionIndex)
    {
    Resolution resolution = resolutions[resolutionIndex];
    Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
    }
    public void SetVolume(float volume)
    {
    audioMixer.SetFloat("volume", volume);
    }
    public void SetQuality (int qualityIndex)
    {
    QualitySettings.SetQualityLevel(qualityIndex);
    }
    public void SetFullscreen (bool isFullscreen)
    {
    Screen.fullScreen = isFullscreen;
    }
    }
    (the text mesh pro is only if you are using it)

    • @derangeddoffy
      @derangeddoffy 2 роки тому

      Thank you so much, I wasn't able to do resolution dropdown.

    • @ichigo765
      @ichigo765 Рік тому

      thanks, your a life saver. i dont know why mine wasnt working

    • @Frazcaideadlol__
      @Frazcaideadlol__ Рік тому

      We need more people like you.

  • @dewybeat2409
    @dewybeat2409 4 роки тому +6

    To people like me who's having trouble with the volume here's something that works:
    public AudioMixer audioMixer;
    [SerializeField] AudioSource audioSrc;
    public float Nvolume = 1f;
    void Update()
    {
    audioSrc.volume = Nvolume;
    }
    public void SetVolume(float volume)
    {
    Nvolume = volume;
    audioMixer.SetFloat("volume", Nvolume);
    }

  • @ben_insomnia
    @ben_insomnia 3 місяці тому

    My GOAT, 6 years later and all of this is still helpful

  • @maxencecrouzy2196
    @maxencecrouzy2196 4 роки тому +2

    I almost never comment on videos but dude you just saved my programming project!

  • @kawaiianthony8090
    @kawaiianthony8090 3 роки тому +17

    1:15 Volume
    5:40 Graphics
    7:50 Fullscreen
    9:15 Resolution

  • @wgregoryw21
    @wgregoryw21 2 роки тому +4

    If you see the bar in the MainMixer go up and down but the volume doesn't change you have to add:
    public AudioMixerGroup mixerGroup; in your AudioManager script and then inside the foreach(Sound s in sounds) after the s.source = gameObject.AddComponent();
    you have to put s.source.outputAudioMixerGroup = mixerGroup; after that open the MainMixer icon in your assets and drag the "Master" inside the public mixerGroup in editor!

  • @EUBEEN123
    @EUBEEN123 4 роки тому +1

    I'm always so happy when I finish writing the scripts and there are no errors

  • @ACBros_06
    @ACBros_06 9 місяців тому +1

    Still the greatest source of info on internet

  • @peterchow172
    @peterchow172 4 роки тому +5

    For those whose volume doesn't change after using the slider, add this to your code:
    AudioMixer audioMixer = Resources.Load("MainMixer");
    AudioMixerGroup[] audioMixGroup = audioMixer.FindMatchingGroups("Master");
    audioSource.outputAudioMixerGroup = audioMixGroup[0];
    Also, you have to go to the audiosource component of the audioclip you want to lower the sound of and change the output section to Master(AudioMixer).

  • @aalim-kn6lq
    @aalim-kn6lq 4 роки тому +4

    if anyone was wondering, this is how i think is an easy way to use the volume slider:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class OptionMenu : MonoBehaviour
    {

    public void SetVolume(float volume)
    {
    AudioListener.volume = volume;

    }
    }
    hope it helped!

  • @SH-pu6wf
    @SH-pu6wf 5 років тому +1

    Honestly, without your tutorials i would never finish my game. BIG THANK TO YOU!

    • @EngiNetion
      @EngiNetion 4 роки тому

      Can i play your game?

    • @Stigma536
      @Stigma536 Рік тому

      i also want to play your game :>

  • @The_Ministry_of_War_Network
    @The_Ministry_of_War_Network 2 роки тому +1

    he just a big brain master of all unity the god of all dev games

  • @aidenkimmerling7221
    @aidenkimmerling7221 4 роки тому +9

    So I know this is an old video, but the Graphics dropdown only actually works when my mouse is hovering over the Quality section in the Project Settings tab

  • @creatingwithlove
    @creatingwithlove 3 роки тому +3

    Love the tutorial. Wish you were still making them.

  • @everton.colombo
    @everton.colombo 6 років тому

    Dude, you don't even know how your tutorials have been helping me, thanks.

  • @dogcakewog
    @dogcakewog 3 місяці тому

    This is actually way easier than I thought it would be

  • @anommahartha2357
    @anommahartha2357 5 років тому +14

    remember to Increase volume on "Audio Mixer", and add Output -> Master to your "Audio source" component... :D

    • @rinodipaola761
      @rinodipaola761 3 роки тому +1

      Thank you, you saved my life!! :D

    • @OBEYOTTERZ
      @OBEYOTTERZ 2 роки тому

      THANK YOU SO MUUUUUUUUCHHHHHHHHHHHHHHHH

  • @BottledWater
    @BottledWater 6 років тому +45

    can you make a tutorial on how to save these settings when the game gets closed? would this also apply to other things in the game (lives, unlocked levels, etc.)

    • @SerhiiZhydel
      @SerhiiZhydel 6 років тому +2

      so unity doesn't load these settings after restart? did you check it?

    • @Definitely_a_Fox
      @Definitely_a_Fox 5 років тому +9

      He did a video on saving and loading values. Maybe you want to check that out.

    • @vda1_327
      @vda1_327 4 роки тому +2

      yes i need that too

    • @Croccolucho
      @Croccolucho 3 роки тому +1

      @@Definitely_a_Fox can you please give me the link?

    • @Definitely_a_Fox
      @Definitely_a_Fox 3 роки тому

      @@Croccolucho Okay, a quick look through their video''s was all you needed to do.
      ua-cam.com/video/XOjd_qU2Ido/v-deo.html

  • @b1llspc
    @b1llspc Рік тому +2

    Hey you! Having issues with the Volume Slider not working because you're using DontDestroyOnLoad() to keep music between scenes? I gotchu.
    In your AudioManager script, add this :
    public AudioMixerGroup mix;
    and in your foreach (Sound s in sounds), add this:
    s.source.outputAudioMixerGroup = mix;
    You can change the variable names as needed of course - the main idea is that A) Unity needs to be able to grab the proper Audio Mixer item through code, even when switching scenes, and B) you need to use the outputAudioMixerGroup functionality in Sound (s.source in the above) to edit the Mixer controls from the code! Hope this helps you solve this bug faster than I did lol

  • @saniti4776
    @saniti4776 4 роки тому +2

    THAAAAANKS TEACHER BRACKEYS

  • @MostafaTElmansoury
    @MostafaTElmansoury 6 років тому +22

    Please make a tutorial on how to map controller input.

    • @netbat
      @netbat 4 роки тому +1

      it's in project settings > Input

  • @nxt_tim
    @nxt_tim 6 років тому +122

    dat christmas hat tho :D

    • @cenullum
      @cenullum 6 років тому +1

      TimTube i thought it was judge hair 😀

    • @zeenzw6678
      @zeenzw6678 6 років тому

      Lol deutscher iz da

  • @BubbyGamingOfficial
    @BubbyGamingOfficial 3 роки тому +2

    Hey guys just to point out if your using a TMP dropdown you must put
    Using TMPro; At The Top
    And
    Public TMP_Dropdown resolutionDropdown;
    Hope This Helps Someone

    • @suspecm6316
      @suspecm6316 3 роки тому +1

      Exactly what I was looking for. Thank you very much!

  • @Raccoon469
    @Raccoon469 2 роки тому +2

    1 second in: I love that hat!

  • @DayMoniakkEdits
    @DayMoniakkEdits 6 років тому +3

    You can also save all theses values in the PlayerProperties for load the settings each time you change or restart scenes

    • @Parona1337
      @Parona1337 6 років тому

      How? It doesnt work for me

  • @Seshua87
    @Seshua87 11 місяців тому +6

    No offense to you Brackeys

  • @EurojuegosBsAs
    @EurojuegosBsAs 2 роки тому +2

    public TMPro.TMP_Dropdown resolutionDropdown;
    In case you are using a newer Unity build, and can't drag and drop the Dropdown object in the Inspector

  • @timwit333
    @timwit333 6 років тому

    DUUUDE, just arrived at the point in my personal project where I have to implement the settings menu! Best timing ever!

  • @ie585
    @ie585 6 років тому +14

    To fix the bug with repeat resolution you need to disable the extra support for the aspect ratio in the player settings. After that, the bug with the rotation resolution will be lost. P.S. sorry for the bad english.
    People need it in the top!

    • @F3NR1R04
      @F3NR1R04 5 років тому

      thanks a ton!

    • @moenator509
      @moenator509 5 років тому +1

      I cant find the extra support T_T, Help

    • @sconosciutosconosciuto2196
      @sconosciutosconosciuto2196 5 років тому +1

      @@moenator509 me too :(

    • @mikecastilho1010
      @mikecastilho1010 5 років тому +3

      @@zhuohuichen9444 The solution is pretty simple actually the duplicates are different refresh rates for the resolutions, since brackeys only picked the sizes of width and height in the string you can't see then you can keep the duplicates and add the refresh rates using something like string option = resolutions[i].ToString();
      or filter all non-60hz results using
      resolutions = Screen.resolutions.Where(resolution => resolution.refreshRate == 60).ToArray(); istead of resolutions = Screen.resolutions; just make sure you are using System.Linq o/

    • @g5fighter
      @g5fighter 5 років тому

      @@mikecastilho1010 Also you can do this
      List options = new List();
      int currentResolutionIndex = 0;
      for (int i = 0; i < resolutions.Length; i++)
      {
      string option = resolutions[i].width + "x" + resolutions[i].height + ":" + resolutions[i].refreshRate + "Hz";
      options.Add(option);
      if(resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height && resolutions[i].refreshRate == Screen.currentResolution.refreshRate)
      {
      currentResolutionIndex = i;
      }
      }
      resolutionDropdown.AddOptions(options);
      resolutionDropdown.value = currentResolutionIndex;
      resolutionDropdown.RefreshShownValue();
      public void SetResolution(int resolutionIndex)
      {
      Resolution resolution = resolutions[resolutionIndex];
      Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen, resolution.refreshRate);
      }

  • @a_soulspark
    @a_soulspark 6 років тому +10

    I couldn't stop laughing at the start of the video!
    Nice look Brackeys :)

  • @lukemoore7319
    @lukemoore7319 6 років тому +2

    Dude u are so great, I love these tutorials, gonna pass my uni degree based on half of this stuff 😂😂 keep it up 😍

  • @billylansar1392
    @billylansar1392 6 років тому

    Spanish: El mejor tutorial de Unity es este. Yo pude programar con exito el menu de mi juego. Muchas gracias, saludos desde Colombia. English: The best Unity tutorial is this one. I could reprogram sucesfully the menu of my game. Thank you very much, greatings for Colombia. ☺😀👏👍

  • @ASSSGROUP
    @ASSSGROUP 6 років тому +7

    sorry but i have a problem when my option menu is loaded after playing one scene, it gets to default..(which is high)

  • @CrunchyPie
    @CrunchyPie 6 років тому +11

    Make Tutorial about when you press esc you can resume game,quit,and option

    • @jorjolandes
      @jorjolandes 6 років тому +3

      He explain this in one of the "Tower Defense" videos. In this one ua-cam.com/video/789gM9R3htc/v-deo.html

  • @mayaG183
    @mayaG183 6 років тому

    I just found this channel yesterday this is so helpful and amazing. I don't know how else to thank you as soon as I have a stable income I will become a patron supporter!!!

  • @Shinobi31415926
    @Shinobi31415926 6 років тому +1

    Loving these UI tutorials. Keep 'em coming!!!

  • @theunknowndev_
    @theunknowndev_ 6 років тому +16

    on Low Quality my Images and Fonts are the same quality as in High. How can I change this?

  • @echo9dev
    @echo9dev 3 роки тому +8

    I’m good at programming, especially 2d player movement but when it comes to settings, brainUnderstands = false;

  • @hyp3240
    @hyp3240 7 місяців тому

    Amazing tutorial, helped me get through volume slider and graphics options, thank you

  • @dragongeek8676
    @dragongeek8676 2 роки тому +1

    Having one issue and have not been able to fix it. if you have it set to window mode and open the settings menu it changes the resolution back to what your screen is.

  • @serpnta1267
    @serpnta1267 6 років тому +4

    For those of you getting several of the same resolutions in your resolution drop down, you can get rid of them by going into Edit, Project Settings, Player, Resolution and Presentation and find the Support Aspect Ratios, then untick 4:3, 5:4, and other. You will no longer have the smaller number of resolutions but you won't have any duplicates. The lowest resolution you can then choose is 1280 x 720 (or at least it is for me). If you need something smaller, you may have to do some coding or live with the duplicates..

  • @blackjackveteran
    @blackjackveteran 4 роки тому +7

    when i use the slider the audio mixer changes but the sound does not increase or decrease at all

    • @kondzio3500
      @kondzio3500 3 роки тому +1

      I gave same problem.
      i know u wrote it 8 months ago, but did u find solution?

    • @blackjackveteran
      @blackjackveteran 3 роки тому +5

      @@kondzio3500 sure, go to your audio source, there should be a slot for an audio mixer. This is to tell which sound to mute and which to not, you can have 2 audio mixers: music and sfx, and 2 sliders and that is so when you mute music sfx doesnt get affected and this is the solution

  • @MikeyyMonty
    @MikeyyMonty 6 років тому

    I was just looking for this! Thank you yet again Brackeys!!!!!

  • @williamhiciano394
    @williamhiciano394 2 роки тому

    five years later this is the top of the top

  • @sandrocutri520
    @sandrocutri520 4 роки тому +44

    The Ultimate Game UI costs now😭

    • @bevvy.bee9
      @bevvy.bee9 4 роки тому +1

      nOOOOOOOO!!!!!

    • @refdelx
      @refdelx 4 роки тому +2

      I know, its so annoying

    • @anishsr1181
      @anishsr1181 4 роки тому

      It's 25$😭

    • @KrakinTheKonsole
      @KrakinTheKonsole 4 роки тому +2

      NO GOD! NO GOD! PLEASE NO NO NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

    • @EgeSayn
      @EgeSayn 4 роки тому +1

      @@west770 I mean it would be completely okay if it was not free in the very beginning. But he changed the price right after this video (it is 2nd time I am watching this video). It is not a nice thing to do.

  • @stephanebessette6471
    @stephanebessette6471 5 років тому +12

    Set the volume slider to go from 0 to 1 and use this code to have a linear sound slider:
    public void SetVolume(float decimalVolume)
    {
    var dbVolume = Mathf.Log10(decimalVolume) * 20;
    if (decimalVolume == 0.0f)
    {
    dbVolume = -80.0f;
    }
    audioMixer.SetFloat("volume", dbVolume);
    }

  • @HitsquadYT
    @HitsquadYT 2 роки тому

    Thx bro you always been there helping even tho you gone now you still helping people

  • @IzeIzeBaby
    @IzeIzeBaby 6 років тому

    Best tutorial i have ever seen about unity's ui. Nice.

  • @DavidBrit101
    @DavidBrit101 4 роки тому +19

    1:03 was free, feelsbadman

    • @marcuslane6289
      @marcuslane6289 4 роки тому +1

      Yeah probs got an influx of traffic from this vid and decide to price it up :(

    • @JeloOW
      @JeloOW 3 роки тому

      FeelsOkayMan there are probably better free alternatives

  • @Chrras
    @Chrras 2 роки тому +4

    Nice tutorial, but I am a bit surprised that it didn't touch upon the volume slider being logarithmic (due to it being tied with the sound in dB). The way it is showcased here, you get a very sensitive slider, which is not very user friendly at all

    • @whereistheguru.
      @whereistheguru. 2 роки тому

      You're so very right, do you have a working solution of how to modify it to work perfectly from 0% to 100% of volume?

    • @CalledCracki
      @CalledCracki 2 роки тому

      @@whereistheguru. try this
      audioMixer.SetFloat("volume", Mathf.Log10(volume) * 20);
      [be aware of variable names]

  • @chakibchemso
    @chakibchemso 5 років тому +1

    the best channel i learnt from it for ever

  • @JimGiant
    @JimGiant 6 років тому

    Can't thank you enough for this! Didn't expect to learn anywhere near this much!

  • @algirdaslalys3387
    @algirdaslalys3387 6 років тому +3

    Does anyone has the same bug with builded version in resolution dropdown, where some resolutions are duplicated? You can see same in video (16:23) 720 x 480, 720 x 480. Btw thank you for your professional work, you are awesome:)

    • @JackLOJBond
      @JackLOJBond 6 років тому

      For me, all the refresh rates are the same (40Hz)! Any idea as to why?

  • @bahaatamer1245
    @bahaatamer1245 6 років тому +9

    As much as I used to love (and I still do) your videos teaching us about this engine, the only negative thing you have is that you are a little bit way too fast! Sometimes I can't follow up with what is being said, otherwise your videos are brilliant!

    • @MaidenOfDread
      @MaidenOfDread 6 років тому +4

      Explore17 You can always change the speed of the video :P

  • @grimsladeleviathan3958
    @grimsladeleviathan3958 5 років тому

    This video has been really really helpful! I tried to make an option menu, and some stuff didn't work, after watching this video, I found what I did wrong. Thanks, Brackeys!
    Love the christmas hat btw

  • @safalsawantpersonal9839
    @safalsawantpersonal9839 2 роки тому

    THANKS A LOT MAN I WOULD HAVE STRUGGLED WITH THIS FOR AGES IF YOU WOULD WERE NOT THERE!!

  • @CraftyMaelyss
    @CraftyMaelyss 4 роки тому +4

    5:36 For some reason, when I drag the handle, it either goes to 0 or -80 but never in between P:

  • @MrAimss
    @MrAimss 4 роки тому +10

    I dont know why, but my graphic dropdown wount work. And i tried everything! Can someone Help me?

    • @baconslayer
      @baconslayer 4 роки тому

      Change the value of the dropdown

    • @GontyWasHere
      @GontyWasHere 4 роки тому

      @@baconslayer I tried this and it did nothing. I am having the same problem and all it did was change the default of the dropdown.

    • @baconslayer
      @baconslayer 4 роки тому

      @@GontyWasHere is the dropdown Text mesh pro?

    • @baconslayer
      @baconslayer 4 роки тому

      @@GontyWasHere ok so first put at the top of your code put using TMPro now when your referencing the dropdown put public TMP_Dropdown resolutiondropdown

    • @GontyWasHere
      @GontyWasHere 4 роки тому

      @@baconslayer I already did all that. also, I am talking about the graphics dropdown, not the resolution dropdown.

  • @ccr0co974
    @ccr0co974 2 роки тому +2

    Does the settings save when quit game

  • @DriitzzCabal
    @DriitzzCabal 6 років тому

    i had issue with my text being crisp and clear in the editor but blurried when building the game , this totally fixed it AND it wasn't even related to that LOL! thanks brackeys you the man

  • @ApexArtistX
    @ApexArtistX 6 років тому +18

    the audio slider does not saved when changing scenes, looks like a bug.... can you combine this volume slider with another tutorial AudioManager singleton ?

    • @Racools
      @Racools 5 років тому

      i consider myself new to coding and unity overall and even i know this is just sloppy. like you know what problems will happen before they even happen type of sloppy.

    • @paranoidpanda7694
      @paranoidpanda7694 4 роки тому

      @@Racools It changes when going to new scenes because the options aren't being saved. You'll need to implement a save and load system for settings

    • @XiaoZong322
      @XiaoZong322 4 роки тому

      I second this question. Would like a tutorial of the audio mixer (or the slider) working with AudioManager

    • @alleyesonme1432
      @alleyesonme1432 4 роки тому +2

      @@XiaoZong322 Brackeys is good and all, but most of times he doesn't show all nuances of his scripts and how to fix simple problems. You will need to jump around UA-cam to find solutions to very simple problems arising from his scripts to fix them. Here what i found and used. First link to slider problem (slider doesn't work properly - like starting to tune down sound only after 50% of slider) and second video about mute button. Hope that helps.
      gamedevbeginner.com/10-unity-audio-tips-that-you-wont-find-in-the-tutorials/ - 9-th tip, slider problem.
      ua-cam.com/video/OeZuwgG6HJM/v-deo.html - mute button video.

    • @davegorbik1033
      @davegorbik1033 4 роки тому +3

      try this guys :
      ibb.co/GFCWS2v

  • @briandoeslife7182
    @briandoeslife7182 6 років тому +3

    I was confused why it wasn't working and found out why
    In audio source you need to click the circle on the end of output and then hit master

  • @Nightlurk
    @Nightlurk 6 років тому +1

    Never thought I'd be taking lessons from one of Santa's little elves.

  • @sartr593
    @sartr593 6 років тому +10

    hmm, I did everything like you showed in this video and my master volume changes with volume slider, but music in my game doesn't change at all (and other sound effects as well)! That is very weird and I am stuck 🤔

    • @tranquilmagister8481
      @tranquilmagister8481 6 років тому +3

      found the solution? cause i think i have the same thing; and nothing seems to work...

    • @sartr593
      @sartr593 6 років тому +7

      Yeah, in Audio Source Component (where you set your audio) add MainMixer->Master in the Output.

    • @tranquilmagister8481
      @tranquilmagister8481 6 років тому

      Thank you so much! that was exactly what i did wrong.

    • @badluckderp
      @badluckderp 6 років тому

      how did you connect the audio in the slider?

    • @jagpreetsingh4993
      @jagpreetsingh4993 6 років тому

      You just me a lot of headache and time.. Thank you, you goddamn bloody legend

  • @akebengtsson4857
    @akebengtsson4857 6 років тому +5

    I have ALWAYS wanted to make a rhythm game! Like those Hatsune Miku Diva games for PS4. However, it seems really complicated with how to make it all works. Can you explain the basics for a rhythm game? - How to force press of certain buttons, multiple buttons, timing rate (cool, fine, sad, worst etc), keeping a combo/breaking a combo, hold notes and etc. You would really be of help! :D

  • @jasminpatel679
    @jasminpatel679 3 роки тому +2

    When I build and run my project in unity , dropdown UI element don't show arrow on screen, so how can select options?

  • @StarLuson
    @StarLuson 3 роки тому

    Everything works perfectly and so simple! Thank you so much, with this video today i built the game for the first time.

  • @SavanaStudios
    @SavanaStudios 6 років тому +19

    for some reason i see 4 - 8 of the same resolutions when i use the dropdown, fixes?

    • @yellowgd3936
      @yellowgd3936 6 років тому

      Same problem. Any fix?

    • @SavanaStudios
      @SavanaStudios 6 років тому

      Yellow GD dont worry, when u build the game its good.

    • @brokenos7710
      @brokenos7710 6 років тому +1

      nope still a problem

    • @SavanaStudios
      @SavanaStudios 6 років тому

      really?, mine just got Fixed so i dont think i can help you much on this

    • @Yugenki
      @Yugenki 6 років тому +2

      Having the same problem, works good at editor, but there is some same resolutions at the build

  • @imvanishr8641
    @imvanishr8641 4 роки тому +5

    I only can choose SetVolume(float) i dont have the dynamic float could someone help me?

    • @revnation1
      @revnation1 4 роки тому

      i am having the same problem . It might be the new Unity Versions that are causing the problem

    • @hardgames4104
      @hardgames4104 4 роки тому

      I cannot see your code but one possible difference could be, that you are using private variables and [SerializeField] to make them visible in the editor. But you really have to use public variables here. I am using Unity 2019.1 and still have those fields, Brackeys showed in his tutorial.

    • @imvanishr8641
      @imvanishr8641 4 роки тому

      HARDgames i used another tutorial how to do it and it worked without using dynamics

    • @aironnedizon1718
      @aironnedizon1718 4 роки тому

      @@imvanishr8641 what tutorial did u use?

  • @hitlab
    @hitlab 4 роки тому

    Great video! Exactly what I was looking for today. Keep up the awesome work man. Thank you.

  • @Diego0wnz
    @Diego0wnz 4 роки тому

    it's so insane. I just made a game in the 2-week holidays because of you?
    Thanks so much stranger. I mean god brackeys =) haha

  • @EmilM-pb2hn
    @EmilM-pb2hn 5 років тому +3

    Edit: The code brackey's provided (without) some of the options.
    Hello! Does anyone know how I would edit my code in order to filter out any refreshrates other than 60Hz? The code brackey's provided is down below:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
    public class OptionsMenu : MonoBehaviour
    {
    public Dropdown resolutionDropdown;
    Resolution[] resolutions;
    void Start()
    {
    resolutions = Screen.resolutions;
    resolutionDropdown.ClearOptions();
    List options = new List();
    int currentResolutionIndex = 0;
    for (int i = 0; i < resolutions.Length; i++)
    {
    string option = resolutions[i].width + " x " + resolutions[i].height;
    options.Add(option);
    if (resolutions[i].width == Screen.width && resolutions[i].height == Screen.height)
    {
    currentResolutionIndex = i;
    }
    }
    resolutionDropdown.AddOptions(options);
    resolutionDropdown.value = currentResolutionIndex;
    resolutionDropdown.RefreshShownValue();
    }
    public void SetResolution(int resolutionIndex)
    {
    Resolution resolution = resolutions[resolutionIndex];
    Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
    }
    public void SetFullScreen (bool isFullScreen)
    {
    Screen.fullScreen = isFullScreen;
    }
    }
    Note: If you were to build and run this using the tutorial above, you'd get multiple options of the same resolutions, because the refreshrate is recognized by the engine but isn't displayed via the options. My problem is that I'm all too new to programming and unity to figure out what to do in order to filter out the refreshrates from the options list provided to the player.
    Help? Thanks!

    • @g5fighter
      @g5fighter 5 років тому

      List options = new List();
      int currentResolutionIndex = 0;
      for (int i = 0; i < resolutions.Length; i++)
      {
      string option = resolutions[i].width + "x" + resolutions[i].height + ":" + resolutions[i].refreshRate + "Hz";
      options.Add(option);
      if(resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height && resolutions[i].refreshRate == Screen.currentResolution.refreshRate)
      {
      currentResolutionIndex = i;
      }
      }
      resolutionDropdown.AddOptions(options);
      resolutionDropdown.value = currentResolutionIndex;
      resolutionDropdown.RefreshShownValue();
      public void SetResolution(int resolutionIndex)
      {
      Resolution resolution = resolutions[resolutionIndex];
      Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen, resolution.refreshRate);
      }

  • @gamehead1223
    @gamehead1223 5 років тому +7

    Code doesn't work for me, If I try to make a list for my resolutions, I can't get the list to show up in visual studio

  • @MrBalinSuperTV
    @MrBalinSuperTV 6 років тому

    Hope this helps others! For Audio to work, Create a "Resources" folder in Assets, and put the new mixer in. In code Awake() throw the following:
    AudioMixer mixer = Resources.Load("Mixer_Main") as AudioMixer;
    audioSource.outputAudioMixerGroup = mixer.FindMatchingGroups("Master")[0];

    • @travisbritton1180
      @travisbritton1180 6 років тому

      Where's Awake in the code i cant find it

    • @travisbritton1180
      @travisbritton1180 6 років тому

      never mind but there is red line under "outputAudioMixerGroup" idk what to do about it

  • @framedkraken7403
    @framedkraken7403 5 років тому +1

    just saw this tutorial and implemented it! new patreon member incoming !!!

  • @mrGee
    @mrGee 4 роки тому +3

    Thanks for the tutorial I'm getting the following error:
    NullReferenceException: Object reference not set to an instance of an object
    SettingsMenu.Start () (at Assets/UI/Scripts/SettingsMenu.cs:20)

    • @albin6003
      @albin6003 4 роки тому

      Same but i dont know how to fix it