• Version 2 of the menu. View a video of it here: https://www.youtube.com/watch?v=6Aksej8gsz8
  • The new demo scene and post processing stack makes things look awesome.
  • But you can make it look crap if you want of course.

In-game settings menu

This project is an example of how to setup an in-game settings menu in Unity. The main focus is on graphics settings, but I felt just having the graphics settings menu by itself would feel too disjoined so I included it as part of a full menu.

In the end this became very similar to the official Game Jam Menu Template available here:
https://www.assetstore.unity3d.com/en/#!/content/40465

But I think the two menus complement each other. There are some topics in the Game Jam Menu I didn't bother with and I have made no effort towards making this menu plug & play for whatever project you may have. I may consider that in the future, but for now I would get that part from the Game Jam Menu project.

With this project I focused on showing how you can handle in-game graphics settings in Unity. I've seen so many games, even released ones, who just give you the Unity game launcher with "Fast", "Good", "Fantastic" settings which is I think is lazy when it's so easy to do it properly. Unity even let's you adjust every single setting in real time without having to restart the game which some AAA games can't even do.

I also added a game scene as a background so you can instantly see what each setting does. I feel this is something every game should do so you're not just changing settings blindly. It should be immediately clear what each graphics setting does towards the final image. This project could also works as an image effect demo project I guess.

I've learned a lot through this project: About interacting with the new UI system through script, about inheritance and advanced coding topics, I've gotten my hands dirty with Unity events and I've really seen why the new audio mixer is useful. Overall this project has taught me a number of cool new things and I hope it does the same for you.

Here's some of the key features:

  • Can be used with mouse, keyboard or gamepad. It probably works just fine with touch as well seeing as that is pretty much the same as a mouse.
  • Let's you choose graphics presets or customize everything just the way you want it with what I feel is the most intuitive approach I've seen in any game. The game environment is visible at all times and every setting updates immediately giving you instant feedback on what it does.
  • Every setting clearly shows what it's currently set to and what its min and max values are. No guesswork involved like in a lot of games where "Ultra" is the highest for some settings, but others just go to "High". Or games which only show the current setting with a previous/next arrow forcing you to click the next arrow for every single setting just to be sure they are maxed out, or even worse, doing so makes them loop back around to the lowest setting.
  • The code is broken up into separate classes per graphics setting which lets you easily add new graphics settings and set their defaults per preset.
  • A field of view slider which clearly states that it's vertical field of view, but also shows the current horizontal field of view for your screen setup. Total Biscuit would be proud.
  • Audio sliders for everything you want which are mapped logarithmically to the audio mixer giving you a natural volume curve from min to max.
  • Mouseover and click sounds for everything, and tick sounds when you increase/decrease the sliders.
  • Keeps track of the selected UI element. Moving your mouse pointer over an element selects it for the keyboard so pressing up on the keyboard continues from that element. It also remembers which button you clicked to open a panel and selects it again when you return.
  • The scroll view can be scrolled both with a keyboard and a gamepad, in addition to the mouse obviously.
  • Includes my brightness slider image effect which is the first image effect I've ever made.

I feel like this is the best thing I've made in Unity so far and I hope you like it. I reached every goal I set for myself with this project, and that I extended the default capabilities of the Unity UI quite a bit. And even though I struggled a fair bit with the menu, I didn't end up hating the UI system as much as I thought I would. It's actually fairly solid.

As usual you can download the entire project. I hope you find a use for it and the only thing I ask in return is some critique on the project. I would love some feedback on my approach to the code structure, or just some input on what you feel could be solved better or differently in the menu itself.

I made a video showcasing version 2 of the menu here:
https://www.youtube.com/watch?v=6Aksej8gsz8

Øyvind Strømsvik's picture

About Øyvind Strømsvik (TwiiK)

I've been passionate about games all my life and started dabbling in game development about 15 years ago with BlitzBasic,... read more but I quickly lost interest and began doing 3d modeling instead. 3d modeling remained a hobby and I picked up game development again around the release of Unity 2.0. My driving force behind wanting to get back into game development was my lost interest in commercial games as they started appealing to a group of gamers I was no longer in. Indie games were the only games that still looked interesting, but at the same time some of them looked like they would be just as fun to make as to actually play. And many of them were made by just one guy.

Tagged with: 3D, Unity

Standalones

Windows:
Download v.2.0.0 (47.93 MB)

Mac:
Download v.2.0.0 (50.85 MB)
Qunicy's picture

Qunicy

I like the work u do bruh if only I could donate to you so u can continue these wonderful works.

Vein's picture

Vein

Hahaha dickbutt, almost didn't see that. Nice job man looks sweet.

Kain's picture

Kain

I am just getting started with Unity and my first goal was to create something exactly like this to use in any project I created because proper options menus are incredibly important to me and this is probably the best one I've ever seen in any game ever. You saved me probably a hundred hours of work and it's really easy to see how everything was set up. I love that you have a live image that updates instantly in the background, so many games need the exact same functionality. Thank you for creating this and offering it freely so that I can focus on creating games and not spend my first month with Unity getting burnt out on option settings. You are totally a hero.

Øyvind Strømsvik's picture

Øyvind Strømsvik

@Kain: Those are some kind words, thanks. It's always great to hear when someone enjoy something I made. :)

I have some bug fixes and small additional features I want to incorporate into this project when I have some spare time. In fact I think I'll add a "roadmap" to each of my projects so people can easily see what, if anything, I have planned for each project.

Raushen's picture

Raushen

Hey Twiik! Got to say, absolutely love your website and all the stuff on it. I'm pretty new to Unity and coding and the resources and projects on your website aren't just interesting, but also really educating.

You mentioned you might look into making this project plug and play, and while I understand you probably have a lot of things on your plate already I just wanted to say how much I'd love that.

I'm nowhere near your proficiency at Unity or coding just yet, and I spent quite a few hours yesterday breaking down and understanding this project, trying to create a version of it for my own project. I've used Unity's Game Jam menu template, but yours is leaps and bounds ahead. In the end my menu was broken in a lot of ways and didn't even function, but I'm starting to grasp how it works.

So thank you!

One last note - I personally recommend adding maybe a stickied notification or non intrusive kind of post somewhere easy to see about disabling AdBlock on your site. I found your post on ads a few pages in and immediately disabled my AdBlock on this website. I think a lot of people like myself would love to support awesome websites like this with ads, but I just forget half the time.

Øyvind Strømsvik's picture

Øyvind Strømsvik

@Raushen: Sorry for the late reply. I've been away from the website for a long time and I messed up and didn't receive any comment notifications during that time.

Thank you so much for the kind words and your extensive comment.

I want to improve this project and you're right that making it plug & play would be fun, but after thinking about it I think that would require me to reduce the menu to its absolute basics or to make a ton of assumptions about your project. For example I don't know how your project handles sound, I don't what image effects, if any, you have in your project, I don't know how you handle scenes or cameras etc. etc. I don't think it would work. Even the fairly simple official Game Jam Menu Template project makes a lot of such assumptions.

For that reason I think I will try to keep this project the way it is and work on polishing it as best as I can. I want it to be an example of how to do a AAA quality menu in Unity, or at least an example of how AAA menus should be. :p For the moment I think I will wait until Unity 5.4 is released and try to create a new version of this project in Unity 5.4 because it has a lot of new graphics features.

I may consider doing something that's actually plug & play in another project.

Everything I have currently planned for this project or any project on my website is listed next to the comments in the "Roadmap"-tab.

As for AdBlock, do what you wish, if the ads are bothering you or anyone else they can disable them. They are mainly an experiment for me to learn more about earning revenue on the internet and how it is to work with Google. The fact that they pay for my hosting costs is just a fun side effect. They make me almost no money, but this website costs almost no money to run either. :)

Arther's picture

Arther

Hey twiik, the changes I make in this graphic setting menu really do affect the gameplay?

Add new comment

2.0.0 - March 18, 2017
  • Upgraded the project to Unity 5.5.2.
  • Replaced all the image effects with the new official post processing stack.
  • Replaced the demo scene with the new version.
  • Learned about namespaces and put everything in a namespace and removed the GS_ prefix from everything.
  • Cleaned up the code a bit. There's less boiler plate per graphics setting now and it feels more robust.
  • Added Pavel Dobryakov's awesome UI blur: http://twiik.net/resources/apple-style-ui-blur
  • It now automatically switches to the custom preset if you have selected a preset and changes one of the settings.
  • Added a tooltip when you mouseover the UI elements.
1.0.2 - January 10, 2017
  • Upgraded the project to Unity 5.4.4.
  • Added Windows and Mac standalone builds.
  • Added a README.txt to the project.
1.0.1 - January 1, 2016
  • Upgraded the project to Unity 5.3
1.0.0 - August 5, 2015
  • Initial release

Known issues

  • Some of my class names and code structure made the code harder to use in a namespace.
  • The code is still quite rough. For example the SliderBase base class is mainly dedicated to graphics functionality, but I use it for the volume sliders as well.
  • I want the tooltip to show at a fixed position in relation to the element, but I 
    struggled with that and settled for showing it at the cursor's position instead.
  • The tooltip doesn't disappear when you click a button if it's showing because the mouse out event isn't called.
  • I forgot to take keyboard/gamepad navigation into account when I created the tooltip.
  • Basically the tooltip is shit at the moment. :p

Possible future features

  • Read up on saving/loading settings and see if I want to implement that, perhaps using player prefs?
  • Look at implementing something like this: http://www.alanzucconi.com/2015/12/16/color-blindness
  • Add the ability to change resolution and fullscreen mode.
  • Make it possible to rebind key bindings.
  • Add a setting to toggle soft particles. Not sure if it's possible, it wasn't possible when I first started this project.
  • Add a setting to set shadow quality. Not sure if it's possible, it wasn't possible when I first started this project.
  • Add a setting to set hard or soft shadows through script. Not sure if it's possible, it wasn't possible when I first started this project.
  • Modify the Outline script included with the UI system to make it possible to add rectangular outlines along the sides of UI elements. To add selection boxes. I think I prefer that over the pulsating background I have now.
  • Hide the cursor when you press a button on the gamepad and show it again when you move the mouse.