Unity: Resolution Dropdown

  Рет қаралды 21,812

Root Games

Root Games

Жыл бұрын

Learn how to create a resolution dropdown in Unity.
✅ Get my courses with discount:
👉 Unity 2D Master: www.udemy.com/course/unity2dm...
👉 Unity Mobile Course: www.udemy.com/course/unitymob...
👉 Unity Input System with Rebinding: www.udemy.com/course/unity-in...
👍 Save your time and learn Unity faster
-------------------------------------------------------
🔔 Subscribe for more awesome content:
🔴 / @rootgames
-------------------------------------------------------
🟡 Support this channel through donations
Any amount means a lot and will help grow the channel:
👉 PayPal: www.paypal.com/paypalme/rootg...
-------------------------------------------------------
Social Networks:
⭐ Instagram: / rootgamesofficial
⭐ Twitter: / rootgamescro
⭐ TikTok: www.tiktok.com/@rootgamesoffi...
⭐ Facebook: / root-games-10337038860...
-------------------------------------------------------
#unity #resolution #settings #unitytutorial

Пікірлер: 72
@RootGames
@RootGames Жыл бұрын
✅ Get my courses with discount: 👉 Unity 2D Master: www.udemy.com/course/unity2dmaster/?couponCode=NEW-MASTER-MAY 👉 Unity Mobile Course: www.udemy.com/course/unitymobilecourse/?couponCode=MOBILE-MAY 👉 Unity Input System with Rebinding: www.udemy.com/course/unity-input-system-rebind/?couponCode=NEW-INPUT-MAY
@TripalYT
@TripalYT Жыл бұрын
Thanks for this, the listings of all refresh rates was always so cluttering and this fixed that!
@gabrielandraderosa8622
@gabrielandraderosa8622 Ай бұрын
To fix the obsolete problem: change the line 20 to currentRefreshRate = (float)Screen.currentResolution.refreshRateRatio.value;.
@madmanga64
@madmanga64 Жыл бұрын
Quick and easy to follow thanks!
@Bald-E
@Bald-E 6 ай бұрын
Thanks bro! I had an issue but it was just me confusing the "i" with a 1. Works great!
@jozsefacs2224
@jozsefacs2224 Жыл бұрын
Thankyou for the good tutorial from al of the tutorials this is the only one i can follow easy haha. Keep up the good work !
@RootGames
@RootGames Жыл бұрын
Thanks 😀
@rodriferg
@rodriferg 4 ай бұрын
Thanks for this tutorial! You helped me to fix our resolution system ^^
@acarius4747
@acarius4747 Жыл бұрын
That helped a lot, thanks buddy
@Kaldrin
@Kaldrin Ай бұрын
Thanks man
@castlecodersltd
@castlecodersltd 2 күн бұрын
Nice one, thanks😊
@cristiangenete8734
@cristiangenete8734 Жыл бұрын
Thank you for the tutorial! It works.
@RootGames
@RootGames Жыл бұрын
You're welcome! :D
@volverte7908
@volverte7908 10 ай бұрын
Thank you!!!
@felipeagudelo76
@felipeagudelo76 Жыл бұрын
Excelente muchas gracias
@pushthebutton4602
@pushthebutton4602 Жыл бұрын
Hi there, thank you for this, how do I implement Windowed checkbox?
@Ocer.
@Ocer. 7 ай бұрын
Incredibly simple tutorial and well written code
@RootGames
@RootGames 7 ай бұрын
Thanks ❤️
@dmitrycherkashin
@dmitrycherkashin 27 күн бұрын
set the variable "currentRefreshRate" to int, not a float and you do not the get any bugs with resolutions in dropdown. Sry for my english.
@Simulatech
@Simulatech Жыл бұрын
is there a way of doing this without the capped refresh rate?
@ShidaPenns
@ShidaPenns Жыл бұрын
Okay, with ChatGPT's help I finally figured out how to convert a refresh rate int, like 60, to the RefreshRate type it's saying you need for the fourth SetResolution argument. I'm a beginner so I'm proud of this. 😂 (ChatGPT was helpful in the end but holy crap did it give me a lot of wrong answers.) rRate is my refresh rate int, here. And width and height are the resolution sizes, naturally. // create a new RefreshRate instance RefreshRate refreshRate = new RefreshRate(); // set the numerator and denominator properties separately refreshRate.numerator = (uint)rRate; refreshRate.denominator = 1; // Set the display resolution to the selected resolution and refresh rate Screen.SetResolution(width, height, FullScreenMode.ExclusiveFullScreen, refreshRate);
@vistitol
@vistitol Жыл бұрын
Hello. Good tutorial but i have a question, what happen if you hav more than one monitor??? This method is shoings the Resolution of the principal monitor or the Resolution of the monitor where the game is playing??? Thanks.
@RootGames
@RootGames Жыл бұрын
Thanks! This will show resolution of the monitor where you open the game.
@ThatRazzy
@ThatRazzy 10 ай бұрын
@@RootGames Hi there, thank you for the great tutorial. So I'm having a similar issue to the one @vistitol mentioned. No matter which monitor I open the game on, I believe the filtered resolutions list only includes the resolutions/framerates of my main display. My main display is at 60hz and my secondary is at 144hz. Because the list of filtered resolutions only includes those of my main display (I'm assuming), launching the game on my second monitor causes the following error: ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Do you have any suggestions on how to fix this/populate the list with the resolutions/framerates of all connected displays? Thank you in advance!
@unknxwn7381
@unknxwn7381 6 ай бұрын
For some mine works in the editor only and not in the build, i followed step by step
@briangular2115
@briangular2115 Жыл бұрын
excellent tutorial, clearly explained
@RootGames
@RootGames Жыл бұрын
Thanks 🙂
@amees89
@amees89 Жыл бұрын
Hi nice Video! I have a problem tho, the Dropdown menu wont change my Resolution. Its stuck at 600x480 or something and even if I change it to 1920x1080 its still not changing. do you have a solution?
@llibertii
@llibertii 11 ай бұрын
Take a closer look at the line 35 of the tutorial you probably didn't change the resoltutions to filteredResolutions. I had the same issue since instead of rewritting the entire script I just tried to fix the one I had and forgot to change that but luckily I managed to figure that out. Hope that helps!
@nexotin
@nexotin 10 ай бұрын
I dont know how to fix the Error... Assets\Scripts\Resolution.cs(51,53): error CS1061: 'Resolution' does not contain a definition for 'height' and no accessible extension method 'height' accepting a first argument of type 'Resolution' could be found (are you missing a using directive or an assembly reference?)
@mandrutalol3631
@mandrutalol3631 2 ай бұрын
I have the same issue
@mandrutalol3631
@mandrutalol3631 2 ай бұрын
I found the fix, its because i had named my script "Resolution". I changed it smth else and it was solved
@alice0067
@alice0067 Жыл бұрын
i am having a problem with the resolution settings, its working fine in my editor but when i run it in my phone, i can see only one resolution which is the current resolution of my screen. I cant see any other resolutions from that dropdown.
@RootGames
@RootGames Жыл бұрын
I'm not sure that this works for phones.
@EricYoungVFX
@EricYoungVFX Жыл бұрын
thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@Xitman239
@Xitman239 11 ай бұрын
Почему у меня такая ошибка? Cannot convert source type 'UnityEngine.RefreshRate' to target type 'float'
@ZPanda13
@ZPanda13 6 ай бұрын
Idk why, but it shows every resolution except my highest one 1920x1080 (the one I actually run on). it shows 1650x1050 being the highest.
@credormk5770
@credormk5770 5 ай бұрын
Maybe is late but i think it could be the filter by refresh rate.
@castlecodersltd
@castlecodersltd 2 күн бұрын
Is that in the editor? That's the size of the resolution when running from there. Try running a build
@Eastyoffutt
@Eastyoffutt Жыл бұрын
Why does mine glitch on top of each other
@TheGamingDelphox
@TheGamingDelphox Жыл бұрын
The dropdown box always starts at 640x480 60hz (The First Option) even though the build is actually in 1920 x 1080 60hz. Is there a way to fix this?
@voxelzombie6238
@voxelzombie6238 Жыл бұрын
i also have this problem
@TheGamingDelphox
@TheGamingDelphox Жыл бұрын
@@voxelzombie6238 I think I fixed it. I replaced "resolutionDropdown.value = currentResolutionIndex;" with "resolutionDropdown.value = Mathf.Max(options.Count);". currentResolutionIndex had a value of 0, setting the dropdown to the smallest resolution, the new line of code sets the value to the highest amount based on the number of options present.
@Simulatech
@Simulatech Жыл бұрын
@@TheGamingDelphox thank you
@sundee7371
@sundee7371 Ай бұрын
If you replace it the "currentResolutionIndex" becomes useless. It works perfectly fine for me. I am using a Playerprefs.
@Kingdom1190
@Kingdom1190 3 ай бұрын
can you provide me script plz i cant see because font size is too small plz bro i will be very thanksful to you plz
@Armaan8014
@Armaan8014 Жыл бұрын
What if we want the text to be a label/TMPro text instead of a dropdown like this video? kzbin.info/www/bejne/Y4vanGB5Zaene7c The resolution.AddOptions(options) etc parts dont work - what could be the substitute then?
@Markleap
@Markleap Жыл бұрын
everything is the same but still dont work
@limasapenas
@limasapenas 3 ай бұрын
Thanks for the help, my only criticism is that you overestimates the viewer intelligence, so I think you should talk about the minor things you did that you speed up, just so I don't need to go back to see exactly what you did, but besides that, it's a great tutorial.
@uluc0
@uluc0 12 күн бұрын
Skill issue
@pankulas
@pankulas Жыл бұрын
Ok but how to use it in build
@RootGames
@RootGames Жыл бұрын
Use the same code as in the tutorial
@pankulas
@pankulas Жыл бұрын
@@RootGames how to make it change actual resolution
@RootGames
@RootGames Жыл бұрын
@@pankulas Don't understand you. It actually changes the resolution in the build.
@maximtarna6669
@maximtarna6669 Жыл бұрын
not working :/
@RootGames
@RootGames Жыл бұрын
It works. Double check your code. Also, try setting the "currentRefreshRate" variable manually, for example, set it to 60 and you'll only get resolutions with that refresh rate. As I said in the video, you need to make a build to test it correctly.
@EricYoungVFX
@EricYoungVFX Жыл бұрын
Had an issue where it would make each resolution 5 times after building, i guess for variable refresh rates (which i really did NOT want lol) Heres a fix if anyone need it, checks for duplicate resolutions sizes: using System.Linq; //this first line is a reference of where to add it in the script currentRefreshRate = Screen.currentResolution.refreshRate; //this is the actual loop check for (int i = 0; i < resolutions.Length; i++) { if (!filteredResolutions.Any(x => x.width == resolutions[i].width && x.height == resolutions[i].height)) //check if resolution already exists in list { filteredResolutions.Add(resolutions[i]); //add resolution to list if it doesn't exist yet } }
@jaguar1822
@jaguar1822 7 ай бұрын
Thanks a lot, this helps with the issue of repeated resolutions :D
@ziadmouad5889
@ziadmouad5889 Жыл бұрын
hi i need the code in Reply
@RootGames
@RootGames Жыл бұрын
I don't have the code to copy-paste it but you will learn more if you follow the tutorial and try to write it step by step. Trust me, avoid copy paste without understanding the logic behind the code.
@ziadmouad5889
@ziadmouad5889 Жыл бұрын
​@@RootGames thank you sir for the advice
@legionofregion8825
@legionofregion8825 Ай бұрын
SLOW DOWN
@talismanskulls2857
@talismanskulls2857 11 ай бұрын
Well this sucks if you dont want to use Dropdowns.
@RootGames
@RootGames 11 ай бұрын
Well you can modify the code and use it in other ways. You can go through elements by clicking left/right buttons. Play a little bit with the code.
@talismanskulls2857
@talismanskulls2857 11 ай бұрын
@@RootGames I been trying for 2 weeks now. I am failing badly.
@puriceful
@puriceful Жыл бұрын
non funziona neanche questo😔
@Jelandro_sander
@Jelandro_sander 3 ай бұрын
obsolet
@gabrielandraderosa8622
@gabrielandraderosa8622 Ай бұрын
change the line 20 to currentRefreshRate = (float)Screen.currentResolution.refreshRateRatio.value;
Learn INTERFACES in 5 minutes | Unity
5:38
Root Games
Рет қаралды 3,7 М.
How To Make Your Game Look The Same On All Mobile Screen Sizes - Unity Mobile Game Development
7:50
Awesome Tuts - Anyone Can Learn To Make Games
Рет қаралды 148 М.
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
🍟Best French Fries Homemade #cooking #shorts
00:42
BANKII
Рет қаралды 42 МЛН
ONE MORE SUBSCRIBER FOR 6 MILLION!
00:38
Horror Skunx
Рет қаралды 15 МЛН
When someone reclines their seat ✈️
00:21
Adam W
Рет қаралды 17 МЛН
How much MONEY my Game made (and how much it cost!)
14:00
Code Monkey
Рет қаралды 153 М.
SCRIPTABLE OBJECTS and EVENTS in Unity
6:46
Root Games
Рет қаралды 2,8 М.
Responsive UI in UNITY Tutorial | How to make UI fit any resolution
2:46
The Power of Scriptable Objects as Middle-Men
17:41
samyam
Рет қаралды 116 М.
Improve Your Platformer with Forces | Examples in Unity
7:01
Dawnosaur
Рет қаралды 164 М.
How To Set Resolution in Unity - Complete Unity Menu System
17:59
gamesplusjames
Рет қаралды 36 М.
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30