Creating Difficulties using Toggles.

Joseph Hibbs
Oct 1, 2023

--

First, we will need to create some UI elements, you can go ahead and set up a menu to your liking. Now we will add an empty game object called Toggle Group and add a component called Toggle Group onto it. From there we will add 3 Toggles as child to the Toggle Group and assign each toggles group value to the parent's toggle group component.

Now we will create our script called Toggle Manager we will need to access the UI Elements. We create an array of Toggles and assign all our toggles into it. Then we create methods for toggling easy, medium, and hard to true and accessing the corresponding index of the array. We will create a Toggle Manager game object to put this script in and assign it in the toggles with the appropriate method.

--

--