Quality-Settings Selections in scripting

Hello Guys and Gurls.

I have been working all day on my menu at the start of the game (MainMenu). I have seem to run in a problem however. It is not that I do not have the knowledge to code it myself or time. It is that I do not have the sweetest clue on how to do it without using a different script for all of the inputs.

Anyway, I have got an options GUI set out, not the kind of GUI SCRIPTING, but the 3D text and then click scripting. Now when I click options all is fine, it opens a menu that has all the quality settings on there, the colour rollover works aswell. ALL IS WORKING!

However, my problem occurs now. How do I get it so that when I click an 3DText like “Options_Fantastic” It actually changes it?

Please help, all answers that are reliable get thumbs-up.

The Quality Settings class is the one you want. In particular there is the SetQualityLevel method. The SetQualityLevel page has a good example of how it is used.

Note that as stated in the documentation:

When building a player quality levels that are not used for that platform are stripped. You should not expect a given quality setting to be at a given index. It’s best to query the available quality settings and use the returned index.

So you will need to use QualitySettings.Names first to get the available settings and then use SetQualityLevel to set it to the desired setting. This is documented on the page linked but I had reread it myself to understand so I thought it would be better to point it out.